Permalink
Browse files

Return of the test/helper.rb.

  • Loading branch information...
pupeno committed Dec 26, 2009
1 parent 6c85276 commit 9c94843e6a336a50b66a44c0636c7f9a1b6dd5b8
Showing with 49 additions and 48 deletions.
  1. +48 −0 test/helper.rb
  2. +1 −48 test/test_ubiquitous_user.rb
View
@@ -0,0 +1,48 @@
+require 'rubygems'
+require 'test/unit'
+require 'shoulda'
+require 'mocha'
+require 'ruby-debug'
+
+$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
+$LOAD_PATH.unshift(File.dirname(__FILE__))
+
+# Minimum set ActionController required to test ubiquitous_user
+module ActionController
+ class Base
+ @@helpers = []
+
+ def self.helper(h)
+ @@helpers << h
+ end
+ end
+
+ class RedirectBackError < Exception
+ end
+end
+
+# Default user model.
+class User
+end
+
+# An alternative user model.
+class Person
+end
+
+require 'ubiquitous_user'
+
+class Controller
+ include Usable
+ extend UsableClass
+
+ # Simulate session and flash
+ def initialize
+ @session = {}
+ @flash = {}
+ end
+ attr_accessor :session
+ attr_accessor :flash
+
+ # Allow access to @ubiquitous_user, only for testing purposes.
+ attr_accessor :ubiquitous_user
+end
@@ -1,51 +1,4 @@
-require 'rubygems'
-require 'test/unit'
-require 'shoulda'
-require 'mocha'
-require 'ruby-debug'
-
-$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
-$LOAD_PATH.unshift(File.dirname(__FILE__))
-
-# Minimum set ActionController required to test ubiquitous_user
-module ActionController
- class Base
- @@helpers = []
-
- def self.helper(h)
- @@helpers << h
- end
- end
-
- class RedirectBackError < Exception
- end
-end
-
-# Default user model.
-class User
-end
-
-# An alternative user model.
-class Person
-end
-
-require 'ubiquitous_user'
-
-class Controller
- include Usable
- extend UsableClass
-
- # Simulate session and flash
- def initialize
- @session = {}
- @flash = {}
- end
- attr_accessor :session
- attr_accessor :flash
-
- # Allow access to @ubiquitous_user, only for testing purposes.
- attr_accessor :ubiquitous_user
-end
+require 'helper'
class TestUbiquitousUser < Test::Unit::TestCase
context "A controller and a mock user" do

0 comments on commit 9c94843

Please sign in to comment.