sr (owner)

Revisions

  • d543f5 sr Thu Jun 25 08:48:59 -0700 2009
gist: 135935 Download_button fork
public
Public Clone URL: git://gist.github.com/135935.git
Embed All Files: show embed
Text #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
commit fdedd64f5800f77b7c885bb12d75fb07acdb3cce
Author: Simon Rozet <simon@rozet.name>
Date: Wed Jun 24 22:00:25 2009 +0200
 
    Do not overide Webrat.session_class in fake session
 
diff --git a/spec/fakes/test_session.rb b/spec/fakes/test_session.rb
index 8679410..b64698e 100644
--- a/spec/fakes/test_session.rb
+++ b/spec/fakes/test_session.rb
@@ -1,12 +1,20 @@
 module Webrat #:nodoc:
+ class << self
+ attr_accessor :test
+
+ alias_method :__session_class, :session_class
+ end
+
   def self.session_class #:nodoc:
- TestSession
+ test ? TestSession : __session_class
   end
 
- class TestSession < Session #:nodoc:
+ class TestSession #:nodoc:
     attr_accessor :response_body
     attr_writer :response_code
 
+ def initialize(context); end
+
     def doc_root
       File.expand_path(File.join(".", "public"))
     end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 084ff85..0373eba 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -38,13 +38,10 @@ Spec::Runner.configure do |config|
 
   config.before :each do
     Webrat.cache_config_for_test
+ Webrat.test = true
   end
 
   config.after :each do
     Webrat.reset_for_test
   end
 end
-
-Webrat.configure do |config|
- config.mode = :merb
-end