[rspec-users] formatting of one-line specs - question

2011-01-16 Thread andyl
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

[rspec-users] Stubs and Object Constructor

2011-03-22 Thread andyl
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

Re: [rspec-users] Stubs and Object Constructor

2011-03-22 Thread andyl
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

Re: [rspec-users] Stubs and Object Constructor

2011-03-22 Thread andyl
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

Re: [rspec-users] Stubs and Object Constructor

2011-03-23 Thread andyl
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

[rspec-users] Mocks and CL Programs

2011-04-05 Thread andyl
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

Re: [rspec-users] Faking Files, Data, Git interractions with mocks/stubs/fixtures

2011-04-21 Thread andyl
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