Displaying 2 results from an estimated 2 matches for "a_spec".
Did you mean:
_spec
2007 May 10
12
shared descriptions -- a couple of issues
...inst pulling in the file
multiple times. I''ve worked around this in rails for now by naming
the shared file XXX_shared.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
.
Fini...
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,