Re: [rspec-users] mocking the shell command (Kernel module)

2008-09-13 Thread Joaquin Rivera Padron
cool, thanks 2008/9/13 Matt Wynne <[EMAIL PROTECTED]> > On 13 Sep 2008, at 13:42, Joaquin Rivera Padron wrote: > > hi, > this did the trick: > > class Shell > def self.sh command > %{ command } > end > end > > then I am able to: > > it "should be mock alright" do >Shell.shou

Re: [rspec-users] mocking the shell command (Kernel module)

2008-09-13 Thread Matt Wynne
On 13 Sep 2008, at 13:42, Joaquin Rivera Padron wrote: hi, this did the trick: class Shell def self.sh command %{ command } end end then I am able to: it "should be mock alright" do Shell.should_receive(...).with(...) end is that correct so? You've definitely got the i

Re: [rspec-users] mocking the shell command (Kernel module)

2008-09-13 Thread Joaquin Rivera Padron
hi, this did the trick: class Shell def self.sh command %{ command } end end then I am able to: it "should be mock alright" do Shell.should_receive(...).with(...) end is that correct so? sorry aboout latter one (gotta do something about that hotkeys sendind my mails all of

Re: [rspec-users] mocking the shell command (Kernel module)

2008-09-13 Thread Joaquin Rivera Padron
hi, this did the trick: class Shell def self.sh command %{ command } end end then I am able to: it "should be mock alright" do end 2008/9/13 Scott Taylor <[EMAIL PROTECTED]> > > On Sep 12, 2008, at 9:29 AM, Matt Wynne wrote: > > On 12 Sep 2008, at 14:12, Joaquin Rivera Padr

Re: [rspec-users] mocking the shell command (Kernel module)

2008-09-12 Thread Scott Taylor
On Sep 12, 2008, at 9:29 AM, Matt Wynne wrote: On 12 Sep 2008, at 14:12, Joaquin Rivera Padron wrote: what is the best (or any) way of mocking the running of shell commands? e.g. code like the following: def method %{ ls } end spec: it "should list the directory contents" shell = mo

Re: [rspec-users] mocking the shell command (Kernel module)

2008-09-12 Thread Joaquin Rivera Padron
thanks, I'll give that a try joaquin 2008/9/12 Matt Wynne <[EMAIL PROTECTED]> > On 12 Sep 2008, at 14:12, Joaquin Rivera Padron wrote: > > what is the best (or any) way of mocking the running of shell commands? > > e.g. > code like the following: > > def method > %{ ls } > end > > spec: > > it

Re: [rspec-users] mocking the shell command (Kernel module)

2008-09-12 Thread Matt Wynne
On 12 Sep 2008, at 14:12, Joaquin Rivera Padron wrote: what is the best (or any) way of mocking the running of shell commands? e.g. code like the following: def method %{ ls } end spec: it "should list the directory contents" shell = mock(Object) # %{} lives in Kernel module and its su

Re: [rspec-users] mocking the shell command (Kernel module)

2008-09-12 Thread Joaquin Rivera Padron
ooop, sorry the last one goes out unfinished (some gmail hotkey)... hello there, what is the best (or any) way of mocking the running of shell commands? e.g. code like the following: def method %{ ls } end spec: it "should list the directory contents" shell = mock(Object) # %{} lives i