From e4e2de1206172231e6c35641a5cbc1a6e4493445 Mon Sep 17 00:00:00 2001 From: Gwyn Morfey Date: Fri, 18 Apr 2008 16:40:24 +0100 Subject: [PATCH] Missing files --- lib/merb_support/support.rb | 12 ++++++++++++ test/helper_merb.rb | 14 ++++++++++++++ test/helper_rails.rb | 11 +++++++++++ test/mocha_test.rb | 14 ++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 lib/merb_support/support.rb create mode 100644 test/helper_merb.rb create mode 100644 test/helper_rails.rb create mode 100644 test/mocha_test.rb diff --git a/lib/merb_support/support.rb b/lib/merb_support/support.rb new file mode 100644 index 0000000..f7c24ee --- /dev/null +++ b/lib/merb_support/support.rb @@ -0,0 +1,12 @@ +class Hash + def with_indifferent_access + hash = HashWithIndifferentAccess.new(self) + hash.default = self.default + hash + end +end +class NilClass + def to_param + nil + end +end diff --git a/test/helper_merb.rb b/test/helper_merb.rb new file mode 100644 index 0000000..cad48fd --- /dev/null +++ b/test/helper_merb.rb @@ -0,0 +1,14 @@ +require 'merb-core' +require 'merb_stories' +module Merb + module Test + class RspecStory + include Merb::Test::ControllerHelper + include Merb::Test::RouteHelper + include Merb::Test::ViewHelper + def flunk(message) + raise message + end + end + end +end diff --git a/test/helper_rails.rb b/test/helper_rails.rb new file mode 100644 index 0000000..8c0e9b4 --- /dev/null +++ b/test/helper_rails.rb @@ -0,0 +1,11 @@ +require "active_support" +silence_warnings do + require "action_controller" + require "action_controller/integration" +end + +class ActionController::Integration::Session + def flunk(message) + raise message + end +end \ No newline at end of file diff --git a/test/mocha_test.rb b/test/mocha_test.rb new file mode 100644 index 0000000..25185af --- /dev/null +++ b/test/mocha_test.rb @@ -0,0 +1,14 @@ +require File.dirname(__FILE__) + "/helper" + +RAILS_ROOT = "." unless defined?(RAILS_ROOT) + +class FooThing +end + +class MochaTest < Test::Unit::TestCase + def test_mocha + @foo = FooThing.new + @foo.stubs(:bar).returns("bar") + assert_equal @foo.bar, "bar" + end +end