get webrat+cucumber+merb working

i put this in env.rb

require 'webrat'

World do
  w = Object.new
  w.extend(Merb::Test::ViewHelper)
  w.extend(Merb::Test::RouteHelper)
  w.extend(Merb::Test::ControllerHelper)
  w.extend(Webrat::MerbTest)
end
This commit is contained in:
Jeremy Burks 2008-10-05 22:05:01 -05:00
parent 9e673539a5
commit 300880db2f
2 changed files with 99 additions and 97 deletions

View File

@ -1,5 +1,5 @@
#In Merb, we have an RspecStory instead of an integration Session. module Webrat
class Merb::Test::RspecStory module MerbTest
#Our own redirect actions defined below, to deal with the fact that we need to store #Our own redirect actions defined below, to deal with the fact that we need to store
#a controller reference. #a controller reference.
@ -103,6 +103,8 @@ class Merb::Test::RspecStory
raise "assert_response #{resp.inspect} is not supported" raise "assert_response #{resp.inspect} is not supported"
end end
end end
end
end end
class Application < Merb::Controller class Application < Merb::Controller

View File

@ -3,7 +3,7 @@ Dir[File.join(File.dirname(__FILE__), "webrat", "*.rb")].each do |file|
end end
module Webrat module Webrat
VERSION = '0.2.1' VERSION = '0.2.2'
def self.root def self.root
defined?(RAILS_ROOT) ? RAILS_ROOT : Merb.root defined?(RAILS_ROOT) ? RAILS_ROOT : Merb.root
end end