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,23 @@
#!/usr/bin/env ruby
#
# Created by Jim Weirich on 2007-04-10.
# Copyright (c) 2007. All rights reserved.
require 'flexmock/rspec'
module Spec
module Plugins
module MockFramework
include FlexMock::MockContainer
def setup_mocks_for_rspec
# No setup required
end
def verify_mocks_for_rspec
flexmock_verify
end
def teardown_mocks_for_rspec
flexmock_close
end
end
end
end

View file

@ -0,0 +1,19 @@
require 'mocha/standalone'
require 'mocha/object'
module Spec
module Plugins
module MockFramework
include Mocha::Standalone
def setup_mocks_for_rspec
mocha_setup
end
def verify_mocks_for_rspec
mocha_verify
end
def teardown_mocks_for_rspec
mocha_teardown
end
end
end
end

View file

@ -0,0 +1,21 @@
require 'rr'
patterns = ::Spec::Runner::QuietBacktraceTweaker::IGNORE_PATTERNS
patterns.push(RR::Errors::BACKTRACE_IDENTIFIER)
module Spec
module Plugins
module MockFramework
include RR::Extensions::InstanceMethods
def setup_mocks_for_rspec
RR::Space.instance.reset
end
def verify_mocks_for_rspec
RR::Space.instance.verify_doubles
end
def teardown_mocks_for_rspec
RR::Space.instance.reset
end
end
end
end

View file

@ -0,0 +1,20 @@
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "lib", "spec", "mocks"))
require 'spec/mocks/framework'
require 'spec/mocks/extensions'
module Spec
module Plugins
module MockFramework
include Spec::Mocks::ExampleMethods
def setup_mocks_for_rspec
$rspec_mocks ||= Spec::Mocks::Space.new
end
def verify_mocks_for_rspec
$rspec_mocks.verify_all
end
def teardown_mocks_for_rspec
$rspec_mocks.reset_all
end
end
end
end