summaryrefslogtreecommitdiff
path: root/spec/hashie/mash_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/hashie/mash_spec.rb')
-rw-r--r--spec/hashie/mash_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/hashie/mash_spec.rb b/spec/hashie/mash_spec.rb
index ce78052..d6813cf 100644
--- a/spec/hashie/mash_spec.rb
+++ b/spec/hashie/mash_spec.rb
@@ -346,15 +346,25 @@ describe Hashie::Mash do
it 'responds to a set key with a suffix' do
%w(= ? ! _).each do |suffix|
expect(subject).to be_respond_to(:"abc#{suffix}")
- expect(subject.method(:"abc#{suffix}")).to_not be_nil
end
+
+ # it seems for ruby 2.2 :"abc#{suffix}" !== :"abc#{'='}" internally
+ expect(subject.method(:"abc#{'='}")).to_not be_nil
+ expect(subject.method(:"abc#{'?'}")).to_not be_nil
+ expect(subject.method(:"abc#{'!'}")).to_not be_nil
+ expect(subject.method(:"abc#{'_'}")).to_not be_nil
end
it 'responds to an unknown key with a suffix' do
%w(= ? ! _).each do |suffix|
expect(subject).to be_respond_to(:"xyz#{suffix}")
- expect(subject.method(:"xyz#{suffix}")).to_not be_nil
end
+
+ # it seems for ruby 2.2 :"abc#{suffix}" !== :"abc#{'='}" internally
+ expect(subject.method(:"xyz#{'='}")).to_not be_nil
+ expect(subject.method(:"xyz#{'?'}")).to_not be_nil
+ expect(subject.method(:"xyz#{'!'}")).to_not be_nil
+ expect(subject.method(:"xyz#{'_'}")).to_not be_nil
end
it 'does not respond to an unknown key without a suffix' do