rails_helper 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/rails_helper.rb +30 -3
- data/rails_helper.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZjE1MjdhODdmZjk5YTVmYmRjN2ExM2I0MTYyMzM3ZTc0NGI4YmY2NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
M2UzMGZhZDY1N2EwZjM0ZGI3NzNlY2E0NDU4YmYyZWJkMzE5M2U1MQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODJkN2E3NzAzMjA3ZWYxYTgxYTZhOWJkYTkzYzc2MTA4NjJkYzViYTdhNGNj
|
10
|
+
NDllY2RhOGYxNWI3MmU4OWY5ODYyMzAzMzQ1NDAwMjkzNzIxZjA1YzY4NWQ5
|
11
|
+
YzkzNDhjNmMzNGUzMzdiNDdjMDkzZTg1YTU2MGU0ODI0Y2Y5ZWI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWYzYjZhMjZhZmQ0YWVhNzBhNDEyMmYyN2U2NDA4NTM3YjQ5NTY5NzNlZDQ2
|
14
|
+
NjI1NjkxYjhlNzE2NmE5MGJkNzVlZjIzYThkOTQ1YzU0YWY1ZjMzN2YyY2Fm
|
15
|
+
YWVmZjFmMGQ0OGJjNWQwNmZmZGM5N2EzYjBkM2U3YzVmOTQ5MjQ=
|
data/lib/rails_helper.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Helper < (defined?(ActionView::Base) ? ActionView::Base : Object)
|
2
2
|
def Helper.version
|
3
|
-
'2.2.
|
3
|
+
'2.2.2'
|
4
4
|
end
|
5
5
|
|
6
6
|
def Helper.dependencies
|
@@ -69,12 +69,14 @@ class Helper < (defined?(ActionView::Base) ? ActionView::Base : Object)
|
|
69
69
|
# see ./actionpack/test/controller/caching_test.rb OUCH!
|
70
70
|
#
|
71
71
|
def Helper.mock_controller
|
72
|
+
require 'rails'
|
73
|
+
require 'action_controller'
|
72
74
|
require 'action_dispatch/testing/test_request.rb'
|
73
75
|
require 'action_dispatch/testing/test_response.rb'
|
74
76
|
|
75
77
|
store = ActiveSupport::Cache::MemoryStore.new
|
76
78
|
|
77
|
-
controller =
|
79
|
+
controller = mock_controller_class.new
|
78
80
|
controller.perform_caching = true
|
79
81
|
controller.cache_store = store
|
80
82
|
|
@@ -84,10 +86,35 @@ class Helper < (defined?(ActionView::Base) ? ActionView::Base : Object)
|
|
84
86
|
controller.request = request
|
85
87
|
controller.response = response
|
86
88
|
|
87
|
-
|
89
|
+
singleton_class =
|
90
|
+
class << controller
|
91
|
+
self
|
92
|
+
end
|
93
|
+
|
94
|
+
singleton_class.module_eval do
|
95
|
+
define_method(:default_url_options) do
|
96
|
+
@default_url_options ||= (
|
97
|
+
defined?(DefaultUrlOptions) ? DefaultUrlOptions.dup : {}
|
98
|
+
)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
88
102
|
controller
|
89
103
|
end
|
90
104
|
|
105
|
+
def Helper.mock_controller_class
|
106
|
+
unless const_defined?(:Controller)
|
107
|
+
controller_class =
|
108
|
+
if defined?(::ApplicationController)
|
109
|
+
Class.new(::ApplicationController)
|
110
|
+
else
|
111
|
+
Class.new(::ActionController::Base)
|
112
|
+
end
|
113
|
+
const_set(:Controller, controller_class)
|
114
|
+
end
|
115
|
+
return const_get(:Controller)
|
116
|
+
end
|
117
|
+
|
91
118
|
def Helper.current_controller
|
92
119
|
Current.controller
|
93
120
|
end
|
data/rails_helper.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ara T. Howard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails_current
|