Pat Maddox:

> "Shot (Piotr Szotkowski)" <[EMAIL PROTECTED]> writes:

>> it 'should set the debug option properly' do
>>   `binary -d`
>>   Conf.should_receive(:debug=).with true
>> end

> When you use backticks to execute the binary, it runs in
> a separate process, so you can't use mock expectations like that.

Right, that’s why I suggested I could Kernel#eval the binary’s contents
in the current process instead. This would require tricking Trollop, but
I assume I could trick it by hand-crafting ARGV.

> I think you're kind of missing the intention though...

Yeah, I thought so – that’s why I’m asking. :) The previous question
ended up with the conclusion that RSpecing a ‘binary’ through Kernel#`
is a sane way to go:

¹ http://groups.google.com/group/rspec/browse_thread/thread/66dc48522014c5eb

> what I think you want to do is write features with
> cucumber that use the built binary from the outside.

Ah, Cucumber. :) I’ve yet to write my first story; I somehow assumed
these are more oriented toward non-programmers and/or for driving
implementation on a rather higher level, and have to be ‘implemented’
on the RSpec level somehow anyway. I take that these assumptions are
flawed. :)

> But when you write code-level examples, you are not going to run the
> binary. You're just writing examples at a lower level, directly for
> the objects. Make sense?

Hm, I guess I simply need to read up on Cucumber and stories;
I still can’t see how this kind of specification would differ
(in the end) from Kernel#`-based RSpec – i.e., why implementing
the code behind these stories would side-step the underlying issue.
(But the last time I read on stories was pre-Cucumber.)

Is there an example of story/Cucumber-based specification
of a binary’s behaviour available somewhere out there?

-- Shot
-- 
init.d is complete in the sense that brainfuck
is Turing-complete.     -- SanityInAnarchy, /.

Attachment: pgpVMu44ShwCz.pgp
Description: PGP signature

_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to