mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Don't raise for unrecognized options.
When calling Pry.new() or Pry#refresh and passing custom options these options should not be set (and therefor prevent NoMethodErrors from popping up). Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
This commit is contained in:
parent
2a1d39a185
commit
b270761efa
2 changed files with 9 additions and 1 deletions
|
@ -59,7 +59,7 @@ class Pry
|
||||||
end
|
end
|
||||||
|
|
||||||
defaults.merge!(options).each do |key, value|
|
defaults.merge!(options).each do |key, value|
|
||||||
send "#{key}=", value
|
send("#{key}=", value) if respond_to?("#{key}=")
|
||||||
end
|
end
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
|
@ -1322,4 +1322,12 @@ describe Pry do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'setting custom options' do
|
||||||
|
it 'should not raise for unrecognized options' do
|
||||||
|
should.not.raise?(NoMethodError) {
|
||||||
|
instance = Pry.new(:custom_option => 'custom value')
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue