search for: add_shared_behaviour

Displaying 2 results from an estimated 2 matches for "add_shared_behaviour".

2007 May 24
25
Specs for ApplicationController, where to put them?
The Rails ApplicationController (app/controllers/application.rb) serves as an abstract superclass for all other controllers in a Rails application and is a good place to put methods and filters which you want all of your controllers to use. In my case I''m using it to provide methods such as "current_user" and "logged_in?" etc. By default, RSpec
2007 May 10
12
shared descriptions -- a couple of issues
...''a_spec'' describe "not shared" do it_should_behave_like "shared" end Now, try it out: % spec b_spec.rb . Finished in 0.018853 seconds 1 example, 0 failures % spec *_spec.rb /usr/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/dsl/ behaviour.rb:9:in `add_shared_behaviour'': Shared Behaviour ''shared'' already exists (ArgumentError) from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/ runner/extensions/kernel.rb:16:in `register_behaviour'' from /usr/local/lib/ruby/gems/1.8/gems/rspec-0.9.3/lib/spec/ runne...