Skip to content

Instantly share code, notes, and snippets.

@oriolgual
Created November 17, 2010 14:00
Show Gist options
  • Save oriolgual/703406 to your computer and use it in GitHub Desktop.
Save oriolgual/703406 to your computer and use it in GitHub Desktop.
rspec failing feature when a helper has a class inside the module
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