Hello RSpec folks,
I've only been introduced to the world of mock objects since Wednesday
of last week, so go easy on me if I come off as ignorant. :P
So, I'm a big fan of testing, especially since it has really helped to
do refactoring in the past. But, I'm running into an issue that I'm
hoping c
Hi Scott,
Cool - I see what you're saying here. The only thing that I'm a bit
confused still is that it seems like, at least if your system is
starting to get larger, you'd really *want* your fast unit test to help
you catch API changes like this to help you make updates faster.
Having to run a
> Why don't we have a partial mock which will raise an error (or at
> least a warning) when stubbing an object who's class doesn't
> respond_to? the method given? I feel like this sort of simple
> dependency has been brought up 1000 times on the list before, but
> never been explicitly stated.
>
> No idea why you couldn't pass a flag for regression testing:
>
> mock(Foo, :check_methods => true)
>
> Scott
It seems to me this way, too - though I'm obviously biased. :)
It's true that a lot of the dynamic stuff could be problematic - what if
the flag was only for checking methods directly
>
> +1
>
> Tests *are* supposed to influence the way we write production code.
>
> Scott
So maybe we could try it and see how it works out? If it makes things
unhappy, it can always be labeled "a worthwhile effort and experiment".
: )
--
Posted via http://www.ruby-forum.com/.
___
Hello, I'm back again with more questions about mocks and how to do good
testing in general. Let's say I'm writing this EmailSender class and I
want to make it totally awesomely tested with RSpec. Here's how far I've
gotten so far:
require 'net/smtp'
class EmailSender
def send_email
mailer.
Yikes, left out the all-important call:
> describe EmailSender do
> it "Should use Net::SMTP to send email"
> es = EmailSender.new
> es.mailer.should == Net::SMTP
> MockSMTP = mock("Net::SMTP")
> def es.mailer
> MockSMTP
> end
> MockSMTP.should_receive(:start).with(
Ha! Don't I feel silly. Just figured it out, I think.
Sebastian W. wrote:
> Yikes, left out the all-important call:
>
>> describe EmailSender do
>> it "Should use Net::SMTP to send email"
>> es = EmailSender.new
>> es.mailer.should =
Hello RSpec folks,
I'm not sure if I'm doing something wrong with the Heckle integration in
RSpec?
I go to heckle my spec, and everything seems to start out okay. But then
something weird happens:
3 mutations remaining...
2 mutations remaining...
1 mutations remaining...
1 mutations remaining...
Yehuda Katz wrote:
> There is more than 1 bug in Heckle that can produce this behavior. Tim
> Carey
> Smith (halorgium) has been working on a much saner replacement with
> effectively the same feature set called boo_hiss, but I'm not sure if
> it's
> quite ready yet. I've used it a bit but last I
Hello RSpec forum,
So...I realize this is a bit of a crazy question, but I wanted to throw
it out there to see what answers came back: is there any way to start an
"interactive Cucumber" session similar to irb?
For example:
bash> crb
>> Given that I do stuff
>> When I do more stuff
>> Then stuff
Aslak Hellesøy wrote:
> cucumber features/scratchpad.feature:34
>
>
Hi Aslak, I tried running this against one of my own feature files, but
it didn't seem to do anything? I wasn't sure what was supposed to
happen. Any light you can shed would be awesome. : )
> I assume you've stumbled upon
Aslak Hellesøy wrote:
> On Wed, Jan 14, 2009 at 9:57 PM, Tero Tilus wrote:
>
>> 2009-01-14 18:47, aslak hellesoy:
>> > What value vould it bring over plain old:
>> > cucumber features/scratchpad.feature:34
>>
>> You gotta admit that at least the cool-factor would be pretty high. :)
>>
>
> Cool
Aslak Hellesøy wrote:
> On Wed, Jan 14, 2009 at 9:55 PM, Sebastian W.
> wrote:
>
>>
> The :line suffix tells cuke to run only the scenario on that particular
> line.
>
> http://wiki.github.com/aslakhellesoy/cucumber/running-features
> cucumber --help
>
> As
Just in case it wasn't clear from my other comments, yes! Please do! :)
If there's a call for assistance, I'd love to help.
Zach Dennis wrote:
>
> This is a very interesting idea. I like it a lot. I imagine it would
> be fairly easy to write. If someone doesn't do one by this weekend I
> may giv
Hello RSpec mailing list,
I have a question which I'm sure someone here has a "duh!" answer to. :P
A lot of the Ruby programming I do is around installing servers and
automating various tasks. The pattern I use goes as follows, I'm sure
you'll see where the gap is.
Write a failing test. Write eno
Hi David,
I think I see what you're saying, but I admit I'm still a bit confused.
Maybe I'm missing something here, but I can't think of how I would drive
the scripts (even through Cucumber) without actually invoking them, thus
kicking off processes that I don't want.
Real code to illustrate my
Hello RSpec group, is there a way to do RSpec-style shared behaviors in
Cucumber? Or something similar?
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Hello all,
Is there a way to explicitly tell a mock to expect no messages and give
an error if it does? I believe this is the default behavior, but thought
it might be nice for code readers to see.
Thank you!
--
Posted via http://www.ruby-forum.com/.
__
David Chelimsky wrote:
> On Wed, Jun 3, 2009 at 12:46 PM, Sebastian W.
> wrote:
>> Hello all,
>> Is there a way to explicitly tell a mock to expect no messages and give
>> an error if it does? I believe this is the default behavior, but thought
>> it might b
20 matches
Mail list logo