from: http://github.com/rspec/rspec-rails
- no helper specs (yet)
- no routing specs (yet)
- only works with ActiveRecord (for now)
On 7 May 2010 11:59, andrea longhi wrote:
> Hello everybody,
>
> I am experiencing the following problems, I googled quickly but I
> couldn't find any d
Hi all, I've written an expectation for a method that converts a hash
into a url string of name/value pairs. The problem is that the hash is
not traversed in the same order as it is defined so I can not work out
how to test for the correct returned string. The operation of the code
does not require
Thanks Pat,
I wrote my first custom matcher and its all working now.
Jamie
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
Hi,
I am trying to stub a class in my controller and I can't get it to
work, the controller code is:
def show
@server = Server.find(params[:id])
whm = Whm::Client.new @server
@server_load = whm.loadavg
end
and my test code:
before(:each) do
@server = mock_model(Server)
Thanks Ivo,
I was getting a bit confused with the stubs, thanks for the explanation.
Jamie
On 19/04/2008, Ivo Dancet <[EMAIL PROTECTED]> wrote:
> Hi
>
> The 'loadavg' method is an instance method of 'whm', so the test
> should be:
>
> @whm = mock_model(Whm::Client)
> Whm::Client.stub!(:new).
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
need to mock the shell.send_command call also. Any help much
appreciated.
When I run
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
Error, 'command did not return
expected result')
end
On 21/04/2008, Jamie D <[EMAIL PROTECTED]> wrote:
> 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