Re: [rspec-users] Mocking Net::SSH connections

2008-04-21 Thread aslak hellesoy
On Mon, Apr 21, 2008 at 8:03 AM, Jamie D <[EMAIL PROTECTED]> wrote: > Hi, > > So I'm stuck again with creating a mock for Net::SSH, I've managed to > mock the call to Net::SSH.start and yield the Net::SSH mock but I am > totally stuck with mocking the session.shell.sync call and will also > nee

Re: [rspec-users] Mocking Net::SSH connections

2008-04-21 Thread aslak hellesoy
On Mon, Apr 21, 2008 at 8:03 AM, Jamie D <[EMAIL PROTECTED]> wrote: > Hi, > > So I'm stuck again with creating a mock for Net::SSH, I've managed to > mock the call to Net::SSH.start and yield the Net::SSH mock but I am > totally stuck with mocking the session.shell.sync call and will also > nee

[rspec-users] JRuby, RSpec, rcov

2008-04-21 Thread alexander.lystad
Do you guys know of any working version combination of JRuby, RSpec and rcov? Doesn't look like rcov 0.8.1.2, RSpec 1.1.3, JRuby 1.1 is one of them. -- Alexander ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listin

Re: [rspec-users] JRuby, RSpec, rcov

2008-04-21 Thread aslak hellesoy
On Mon, Apr 21, 2008 at 4:05 PM, <[EMAIL PROTECTED]> wrote: > Do you guys know of any working version combination of JRuby, RSpec and > rcov? Doesn't look like rcov 0.8.1.2, RSpec 1.1.3, JRuby 1.1 is one of > them. > Have you tried JRuby 1.1 + RCov 0.8.1.2 in pure mode (without RSpec?) Aslak

[rspec-users] Fixtures in Jruby Mysql

2008-04-21 Thread Thijs Cadier
Hi, I've been developing a Rails frontend to a Java backend which is working great. I'm running into trouble now that I'm adding a few models though. All specs that use fixtures fail. Jruby gives this error message in the Rspec version of two weeks ago: java.sql.SQLException: Can't call rollback

[rspec-users] [ANN] StepSpecr

2008-04-21 Thread Matthias Hennemeyer
Hi, I've written a micro-dsl to spec the step-implementations for rspec user stories. Here is a blog post about it: http://www.workunitgroup.com/2008/4/21/introducing-stepspecr It lives on github: http://github.com/mhennemeyer/stepspecr Some info (from the README) StepSpecr is a Rails plug

Re: [rspec-users] Fixtures in Jruby Mysql

2008-04-21 Thread Thijs Cadier
I just realized I made a mistake in the description of the problem. The specs don't fail, but crash. Nothing after the fixtures line in the spec is executed. -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.o

[rspec-users] Spec the Application Controller application.rb

2008-04-21 Thread Andy Croll
How would I go about writing specs for methods in the Application Controller: I'm thinking of simple methods that do authentication, through before filters or for example how might I spec this method in an application_spec.rb? def store_location session[:return_to] = request.request_uri e

Re: [rspec-users] Spec the Application Controller application.rb

2008-04-21 Thread Pat Maddox
On Mon, Apr 21, 2008 at 8:27 AM, Andy Croll <[EMAIL PROTECTED]> wrote: > How would I go about writing specs for methods in the Application > Controller: > > I'm thinking of simple methods that do authentication, through before > filters or for example how might I spec this method in an > applic

Re: [rspec-users] Mocking Net::SSH connections

2008-04-21 Thread Jamie D
Thanks for the info Aslak, I have rewritten my code like you suggest but have one issue with raising an exception. When I try the code in the console an exception is raised correctly but in my test code I get a message "command did not return expected result" # test describe Ssh, "Remote" do be

Re: [rspec-users] Mocking Net::SSH connections

2008-04-21 Thread Jamie D
Fixed it, I was missing the lambda: it "should raise exception if response does not match expected" do lambda{ @connection.remote_command('server', 'root', [{:command => 'ls /', :expects => /blah/}]) }. should raise_error(Ssh::CommandError, 'command did not return expected result') e