Skip to content

Instantly share code, notes, and snippets.

@timurvafin
Created September 24, 2008 09:31
Show Gist options
  • Save timurvafin/12516 to your computer and use it in GitHub Desktop.
Save timurvafin/12516 to your computer and use it in GitHub Desktop.
require File.dirname(__FILE__) + '/../spec_helper'
describe ApplicationHelper do
include ApplicationHelper
it 'helper setup instance variable' do
helper.setup_instance_var('test')
assigns['test_value'].should == 'test'
end
end
module ApplicationHelper
def setup_instance_var(value)
@test_value = value
end
end
> ./script/spec -fs -c ./spec/helpers/test_helper_spec.rb
ApplicationHelper
- helper setup instance variable (FAILED - 1)
1)
'ApplicationHelper helper setup instance variable' FAILED
expected: "test",
got: nil (using ==)
./spec/helpers/test_helper_spec.rb:8:
./script/spec:4:
Finished in 0.255222 seconds
1 example, 1 failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment