Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gwyn Morfey
committed
Apr 18, 2008
1 parent
2e03051
commit a45d654
Showing
2 changed files
with
45 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,39 @@ | ||
require "rubygems" | ||
require "test/unit" | ||
require "mocha" | ||
|
||
# gem install redgreen for colored test output | ||
begin require "redgreen" unless ENV['TM_CURRENT_LINE']; rescue LoadError; end | ||
require "mocha" | ||
|
||
require "active_support" | ||
if ENV["TEST_MODE"] == "rails" | ||
require "active_support" | ||
silence_warnings do | ||
require "action_controller" | ||
require "action_controller/integration" | ||
end | ||
|
||
silence_warnings do | ||
require "action_controller" | ||
require "action_controller/integration" | ||
class ActionController::Integration::Session | ||
def flunk(message) | ||
raise message | ||
end | ||
end | ||
|
||
elsif ENV["TEST_MODE"] == "merb" | ||
require 'merb-core' | ||
require 'merb_stories' | ||
#require 'spec' #makes mocha cry | ||
module Merb | ||
module Test | ||
class RspecStory | ||
include Merb::Test::ControllerHelper | ||
include Merb::Test::RouteHelper | ||
include Merb::Test::ViewHelper | ||
end | ||
end | ||
end | ||
|
||
else | ||
raise "Please set the environment variable TEST_MODE to either 'rails' or 'merb'." | ||
end | ||
|
||
require File.expand_path(File.dirname(__FILE__) + "/../lib/webrat") | ||
|
||
class ActionController::Integration::Session | ||
def flunk(message) | ||
raise message | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters