summaryrefslogtreecommitdiff
path: root/spec/ruby/language/constants_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/language/constants_spec.rb')
-rw-r--r--spec/ruby/language/constants_spec.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/spec/ruby/language/constants_spec.rb b/spec/ruby/language/constants_spec.rb
index 49ff8844af..5b111f4e81 100644
--- a/spec/ruby/language/constants_spec.rb
+++ b/spec/ruby/language/constants_spec.rb
@@ -458,16 +458,17 @@ describe "Module#private_constant marked constants" do
lambda {mod::Foo}.should raise_error(NameError)
end
- it "sends #const_missing to the original class or module" do
- mod = Module.new
- mod.const_set :Foo, true
- mod.send :private_constant, :Foo
- def mod.const_missing(name)
- @const_missing_arg = name
- name == :Foo ? name : super
- end
+ ruby_version_is "2.6" do
+ it "sends #const_missing to the original class or module" do
+ mod = Module.new
+ mod.const_set :Foo, true
+ mod.send :private_constant, :Foo
+ def mod.const_missing(name)
+ name == :Foo ? name : super
+ end
- mod::Foo.should == :Foo
+ mod::Foo.should == :Foo
+ end
end
describe "in a module" do