Displaying 2 results from an estimated 2 matches for "b_spec".
Did you mean:
_spec
2007 May 10
12
shared descriptions -- a couple of issues
...ared.rb instead of XXX_spec.rb so that the rake
task doesn''t pick it up, but it seems like something that should be
fixed.
To reproduce, create the following files:
a_spec.rb
---------
describe "shared", :shared => true do
it "should do something" do
end
end
b_spec.rb
---------
require ''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/...
2007 May 24
9
Mocking, changing method interfaces and integration tests
Suppose we have a method ''foo'' which internally uses another method
''bar''.
Being good BDDers we mock out the ''bar'' method. After all, we only
want to spec the ''foo'' method - actually running the ''bar'' method
means slower, less maintainable and brittler specs. That''s why we <3
mocking,