Created
November 17, 2010 14:00
-
-
Save oriolgual/703406 to your computer and use it in GitHub Desktop.
rspec failing feature when a helper has a class inside the module
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
Scenario: failing test when a helper has a class inside a module | |
Given a file named "spec/helpers/with_class_helper_spec.rb" with: | |
""" | |
require "spec_helper" | |
describe WithClassHelper do | |
describe FooClass do | |
it 'works' do | |
helper.works.should be_true | |
end | |
end | |
end | |
""" | |
And a file named "app/helpers/with_class_helper.rb" with: | |
""" | |
module WithClassHelper | |
class FooClass | |
def works | |
true | |
end | |
end | |
end | |
""" | |
When I run "rspec spec/helpers/with_class_helper_spec.rb" | |
Then the output should contain "uninitialized constant FooClass" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment