Created
November 10, 2011 07:38
-
-
Save jnicklas/1354361 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Foo | |
Bar = "test" | |
end | |
describe "Foo" do | |
include Foo | |
it "should be included in this context" do | |
Bar.should == 'test' | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/Desktop$ rvm use 1.9.2 | |
Using /Users/jonas/.rvm/gems/ruby-1.9.2-p290 | |
~/Desktop$ rspec test_spec.rb | |
. | |
Finished in 1.88 seconds | |
1 example, 0 failures | |
~/Desktop$ rvm use 1.9.3 | |
Using /Users/jonas/.rvm/gems/ruby-1.9.3-p0 | |
~/Desktop$ rspec test_spec.rb | |
F | |
Failures: | |
1) Foo should be included in this context | |
Failure/Error: Bar.should == 'test' | |
NameError: | |
uninitialized constant Bar | |
# ./test_spec.rb:9:in `block (2 levels) in <top (required)>' | |
Finished in 0.26293 seconds | |
1 example, 1 failure | |
Failed examples: | |
rspec ./test_spec.rb:8 # Foo should be included in this context |
Same happens with JRuby 1.6.5 o.O
self.class.ancestors
returns RSpec::Core::ExampleGroup::Nested_1
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
o.O
What does
puts self.class.ancestors
on line 9 return?