How can I mock the XMLRPC::Client.new3 class method using rspec's mock?
I expected this spec:

        describe Foo do
          it 'should call new3' do
            options = {}
            XMLRPC::Client.any_instance.should_receive(:new3).with(options)
            Foo.new(options)
          end
        end

with this class definition:

        class Foo
          def new(options)
            @server = XMLRPC::Client.new3(options)
          end
        end

to pass but instead I got the error:

          1) Foo should call new 3
             Failure/Error: Unable to find matching line from backtrace
               Exactly one instance should have received the following
message(s) but didn't: new3

How can I change the spec to make this pass (while verifying that new3
was called)?

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

Reply via email to