Added Rspec and Webrat plugins and started porting Selenium on Rails tests to Rspec Plain Text Stories driving Webrat driving Selenium.

This commit is contained in:
Luke Melia 2008-06-18 02:57:57 -04:00
parent 0600756bbf
commit 0f7d6f7a1d
602 changed files with 47788 additions and 29 deletions

View file

@ -0,0 +1,39 @@
module Spec
module Mocks
module Methods
def should_receive(sym, opts={}, &block)
__mock_proxy.add_message_expectation(opts[:expected_from] || caller(1)[0], sym.to_sym, opts, &block)
end
def should_not_receive(sym, &block)
__mock_proxy.add_negative_message_expectation(caller(1)[0], sym.to_sym, &block)
end
def stub!(sym, opts={})
__mock_proxy.add_stub(caller(1)[0], sym.to_sym, opts)
end
def received_message?(sym, *args, &block) #:nodoc:
__mock_proxy.received_message?(sym.to_sym, *args, &block)
end
def rspec_verify #:nodoc:
__mock_proxy.verify
end
def rspec_reset #:nodoc:
__mock_proxy.reset
end
private
def __mock_proxy
if Mock === self
@mock_proxy ||= Proxy.new(self, @name, @options)
else
@mock_proxy ||= Proxy.new(self, self.class.name)
end
end
end
end
end