For easy editing, I love one-line specs, like this:
specify { 1.should == 1 }
But when using '--format documentation', one-line specs don't always
render useful documentation.
A solution is to write one-line specs using do/end:
it "succeeds with do/end" do 1.should == 1 end
That's ok - but
I'm having trouble using stubs to intercept method calls in the object
constructor. Here's some code with a failing example:
class Test2
attr_accessor :msg
def initialize
@msg = sayhi
end
def sayhi
"hi"
end
end
describe Test2, "stubbing
PS: I'm using rspec/rspec-mocks 2.5, Ubuntu 10.10, Ruby 1.8.7
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
OK - I got this working using mocha and the 'any_instance' method.
A gist with working examples is here: https://gist.github.com/879029
It looks like rspec mocks had an 'any_instance' method, but it was removed
because it promoted 'bad practice'.
I'm curious to understand how 'any_instance' p
Pat and David -
Thanks for taking the time to explain this. Look forward to seeing
any_instance in rspec/mocks. And I will try to use it as little as
possible!
;-)
- Andy
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org
I am using rspec/aruba to do integration tests of a command-line program i'm
writing.
I'd like to use something like FakeWeb to stub the network calls in the
command-line program.
But with aruba, the program under test runs in a separate process, and
FakeWeb won't work.
I'm thinking of adding
I've been using the VCR gem lately and it is great.
Maybe this would be useful if you're fetching from git using http??
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users