rspec-rails 2.99.0 → 3.1.0
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 +6 -14
- checksums.yaml.gz.sig +1 -0
- data/.yardopts +1 -1
- data/Capybara.md +1 -3
- data/Changelog.md +148 -11
- data/License.txt +1 -0
- data/README.md +202 -105
- data/lib/generators/rspec/controller/controller_generator.rb +1 -0
- data/lib/generators/rspec/controller/templates/controller_spec.rb +5 -5
- data/lib/generators/rspec/controller/templates/view_spec.rb +2 -2
- data/lib/generators/rspec/feature/feature_generator.rb +16 -0
- data/lib/generators/rspec/feature/templates/feature_spec.rb +5 -0
- data/lib/generators/rspec/helper/helper_generator.rb +1 -0
- data/lib/generators/rspec/helper/templates/helper_spec.rb +2 -2
- data/lib/generators/rspec/install/install_generator.rb +44 -5
- data/lib/generators/rspec/install/templates/spec/{spec_helper.rb.tt → rails_helper.rb} +19 -28
- data/lib/generators/rspec/integration/integration_generator.rb +1 -12
- data/lib/generators/rspec/integration/templates/request_spec.rb +3 -8
- data/lib/generators/rspec/job/job_generator.rb +12 -0
- data/lib/generators/rspec/job/templates/job_spec.rb.erb +7 -0
- data/lib/generators/rspec/mailer/mailer_generator.rb +1 -0
- data/lib/generators/rspec/mailer/templates/mailer_spec.rb +6 -6
- data/lib/generators/rspec/model/model_generator.rb +19 -5
- data/lib/generators/rspec/model/templates/fixtures.yml +1 -1
- data/lib/generators/rspec/model/templates/model_spec.rb +2 -2
- data/lib/generators/rspec/observer/observer_generator.rb +1 -0
- data/lib/generators/rspec/observer/templates/observer_spec.rb +2 -2
- data/lib/generators/rspec/scaffold/scaffold_generator.rb +108 -135
- data/lib/generators/rspec/scaffold/templates/controller_spec.rb +34 -39
- data/lib/generators/rspec/scaffold/templates/edit_spec.rb +5 -13
- data/lib/generators/rspec/scaffold/templates/index_spec.rb +3 -10
- data/lib/generators/rspec/scaffold/templates/new_spec.rb +6 -14
- data/lib/generators/rspec/scaffold/templates/routing_spec.rb +9 -9
- data/lib/generators/rspec/scaffold/templates/show_spec.rb +4 -11
- data/lib/generators/rspec/view/templates/view_spec.rb +2 -2
- data/lib/generators/rspec/view/view_generator.rb +1 -0
- data/lib/generators/rspec.rb +16 -6
- data/lib/rspec/rails/adapters.rb +33 -35
- data/lib/rspec/rails/configuration.rb +97 -0
- data/lib/rspec/rails/example/controller_example_group.rb +173 -159
- data/lib/rspec/rails/example/feature_example_group.rb +25 -20
- data/lib/rspec/rails/example/helper_example_group.rb +27 -26
- data/lib/rspec/rails/example/mailer_example_group.rb +29 -14
- data/lib/rspec/rails/example/model_example_group.rb +7 -7
- data/lib/rspec/rails/example/rails_example_group.rb +1 -0
- data/lib/rspec/rails/example/request_example_group.rb +19 -17
- data/lib/rspec/rails/example/routing_example_group.rb +40 -39
- data/lib/rspec/rails/example/view_example_group.rb +140 -137
- data/lib/rspec/rails/example.rb +0 -33
- data/lib/rspec/rails/extensions/active_record/proxy.rb +0 -1
- data/lib/rspec/rails/extensions.rb +0 -1
- data/lib/rspec/rails/feature_check.rb +35 -0
- data/lib/rspec/rails/fixture_support.rb +5 -12
- data/lib/rspec/rails/matchers/be_a_new.rb +67 -62
- data/lib/rspec/rails/matchers/be_new_record.rb +23 -21
- data/lib/rspec/rails/matchers/be_valid.rb +41 -33
- data/lib/rspec/rails/matchers/have_http_status.rb +361 -0
- data/lib/rspec/rails/matchers/have_rendered.rb +35 -31
- data/lib/rspec/rails/matchers/redirect_to.rb +30 -29
- data/lib/rspec/rails/matchers/relation_match_array.rb +1 -1
- data/lib/rspec/rails/matchers/routing_matchers.rb +104 -94
- data/lib/rspec/rails/matchers.rb +7 -4
- data/lib/rspec/rails/tasks/rspec.rake +1 -1
- data/lib/rspec/rails/vendor/capybara.rb +2 -33
- data/lib/rspec/rails/version.rb +3 -1
- data/lib/rspec/rails/view_assigns.rb +18 -18
- data/lib/rspec/rails/view_rendering.rb +20 -45
- data/lib/rspec/rails.rb +2 -13
- data/lib/rspec-rails.rb +4 -1
- data.tar.gz.sig +0 -0
- metadata +80 -99
- metadata.gz.sig +3 -0
- data/lib/autotest/rails_rspec2.rb +0 -91
- data/lib/generators/rspec/install/templates/.rspec +0 -1
- data/lib/rspec/rails/extensions/active_record/base.rb +0 -58
- data/lib/rspec/rails/infer_type_configuration.rb +0 -26
- data/lib/rspec/rails/matchers/have_extension.rb +0 -36
- data/lib/rspec/rails/mocks.rb +0 -284
- data/lib/rspec/rails/module_inclusion.rb +0 -19
- data/lib/rspec/rails/vendor/webrat.rb +0 -33
data/lib/rspec-rails.rb
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
# Namespace for all core RSpec projects.
|
|
1
2
|
module RSpec
|
|
3
|
+
# Namespace for rspec-rails code.
|
|
2
4
|
module Rails
|
|
5
|
+
# Railtie to hook into Rails.
|
|
3
6
|
class Railtie < ::Rails::Railtie
|
|
4
7
|
# Rails-3.0.1 requires config.app_generators instead of 3.0.0's config.generators
|
|
5
8
|
generators = config.respond_to?(:app_generators) ? config.app_generators : config.generators
|
|
6
9
|
generators.integration_tool :rspec
|
|
7
|
-
generators.test_framework
|
|
10
|
+
generators.test_framework :rspec
|
|
8
11
|
|
|
9
12
|
rake_tasks do
|
|
10
13
|
load "rspec/rails/tasks/rspec.rake"
|
data.tar.gz.sig
ADDED
|
Binary file
|
metadata
CHANGED
|
@@ -1,229 +1,219 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Chelimsky
|
|
8
|
+
- Andy Lindeman
|
|
8
9
|
autorequire:
|
|
9
10
|
bindir: bin
|
|
10
|
-
cert_chain:
|
|
11
|
-
|
|
11
|
+
cert_chain:
|
|
12
|
+
- |
|
|
13
|
+
-----BEGIN CERTIFICATE-----
|
|
14
|
+
MIIDjjCCAnagAwIBAgIBATANBgkqhkiG9w0BAQUFADBGMRIwEAYDVQQDDAlyc3Bl
|
|
15
|
+
Yy1kZXYxGzAZBgoJkiaJk/IsZAEZFgtnb29nbGVnb3VwczETMBEGCgmSJomT8ixk
|
|
16
|
+
ARkWA2NvbTAeFw0xMzExMDcxOTQyNTlaFw0xNDExMDcxOTQyNTlaMEYxEjAQBgNV
|
|
17
|
+
BAMMCXJzcGVjLWRldjEbMBkGCgmSJomT8ixkARkWC2dvb2dsZWdvdXBzMRMwEQYK
|
|
18
|
+
CZImiZPyLGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
|
|
19
|
+
nhCeZouDLXWO55no+EdZNCtjXjfJQ1X9TbPcvBDD29OypIUce2h/VdKXB2gI7ZHs
|
|
20
|
+
F5NkPggslTErGFmWAtIiur7u943RVqHOsyoIsy065F9fCtrykkA+22elvTDha4Iz
|
|
21
|
+
RUCvuhQ3klatYk4jF+cGt1jNONNVdLOiy0bMynvcM7hoVQ2AomwGs+cEOWQ/4dkD
|
|
22
|
+
JcNV3qfzF5QBcTD2372XNM53b25nYVQSX2KH5FF7BhlKyov33bOm2gA9M+mWIujW
|
|
23
|
+
qgkyxVlfrlE+ZBgV3wXn1Cojg1LpTq35yOArgwioyrwwlZZJR9joN9s/nDklfr5A
|
|
24
|
+
+dyETjFc6cmEPWZrt2cJBQIDAQABo4GGMIGDMAkGA1UdEwQCMAAwCwYDVR0PBAQD
|
|
25
|
+
AgSwMB0GA1UdDgQWBBSW+WD7hn1swJ1A7i8tbuFeuNCJCjAkBgNVHREEHTAbgRly
|
|
26
|
+
c3BlYy1kZXZAZ29vZ2xlZ291cHMuY29tMCQGA1UdEgQdMBuBGXJzcGVjLWRldkBn
|
|
27
|
+
b29nbGVnb3Vwcy5jb20wDQYJKoZIhvcNAQEFBQADggEBAH27jAZ8sD7vnXupj6Y+
|
|
28
|
+
BaBdfHtCkFaslLJ0aKuMDIVXwYuKfqoW15cZPDLmSIEBuQFM3lw6d/hEEL4Uo2jZ
|
|
29
|
+
FvtmH5OxifPDzFyUtCL4yp6qgNe/Xf6sDsRg6FmKcpgqCwNOmsViaf0LPSUH/GYQ
|
|
30
|
+
3Teoz8QCaDbD7AKsffT7eDrnbHnKweO1XdemRJC98u/yYxnGzMSWKEsn09etBlZ9
|
|
31
|
+
7H67k5Z3uf6cfLZgToWL6zShzZY3Nun5r73YsNf2/QZOe4UZe4vfGvn6baw53ys9
|
|
32
|
+
1yHC1AcSYpvi2dAbOiHT5iQF+krm4wse8KctXgTNnjMsHEoGKulJS2/sZl90jcCz
|
|
33
|
+
muA=
|
|
34
|
+
-----END CERTIFICATE-----
|
|
35
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
|
12
36
|
dependencies:
|
|
13
37
|
- !ruby/object:Gem::Dependency
|
|
14
38
|
name: activesupport
|
|
15
39
|
requirement: !ruby/object:Gem::Requirement
|
|
16
40
|
requirements:
|
|
17
|
-
- -
|
|
41
|
+
- - ">="
|
|
18
42
|
- !ruby/object:Gem::Version
|
|
19
43
|
version: '3.0'
|
|
20
44
|
type: :runtime
|
|
21
45
|
prerelease: false
|
|
22
46
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
47
|
requirements:
|
|
24
|
-
- -
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '3.0'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: activemodel
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - ! '>='
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '3.0'
|
|
34
|
-
type: :runtime
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - ! '>='
|
|
48
|
+
- - ">="
|
|
39
49
|
- !ruby/object:Gem::Version
|
|
40
50
|
version: '3.0'
|
|
41
51
|
- !ruby/object:Gem::Dependency
|
|
42
52
|
name: actionpack
|
|
43
53
|
requirement: !ruby/object:Gem::Requirement
|
|
44
54
|
requirements:
|
|
45
|
-
- -
|
|
55
|
+
- - ">="
|
|
46
56
|
- !ruby/object:Gem::Version
|
|
47
57
|
version: '3.0'
|
|
48
58
|
type: :runtime
|
|
49
59
|
prerelease: false
|
|
50
60
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
61
|
requirements:
|
|
52
|
-
- -
|
|
62
|
+
- - ">="
|
|
53
63
|
- !ruby/object:Gem::Version
|
|
54
64
|
version: '3.0'
|
|
55
65
|
- !ruby/object:Gem::Dependency
|
|
56
66
|
name: railties
|
|
57
67
|
requirement: !ruby/object:Gem::Requirement
|
|
58
68
|
requirements:
|
|
59
|
-
- -
|
|
69
|
+
- - ">="
|
|
60
70
|
- !ruby/object:Gem::Version
|
|
61
71
|
version: '3.0'
|
|
62
72
|
type: :runtime
|
|
63
73
|
prerelease: false
|
|
64
74
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
75
|
requirements:
|
|
66
|
-
- -
|
|
76
|
+
- - ">="
|
|
67
77
|
- !ruby/object:Gem::Version
|
|
68
78
|
version: '3.0'
|
|
69
79
|
- !ruby/object:Gem::Dependency
|
|
70
80
|
name: rspec-core
|
|
71
81
|
requirement: !ruby/object:Gem::Requirement
|
|
72
82
|
requirements:
|
|
73
|
-
- - ~>
|
|
83
|
+
- - "~>"
|
|
74
84
|
- !ruby/object:Gem::Version
|
|
75
|
-
version:
|
|
85
|
+
version: 3.1.0
|
|
76
86
|
type: :runtime
|
|
77
87
|
prerelease: false
|
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
89
|
requirements:
|
|
80
|
-
- - ~>
|
|
90
|
+
- - "~>"
|
|
81
91
|
- !ruby/object:Gem::Version
|
|
82
|
-
version:
|
|
92
|
+
version: 3.1.0
|
|
83
93
|
- !ruby/object:Gem::Dependency
|
|
84
94
|
name: rspec-expectations
|
|
85
95
|
requirement: !ruby/object:Gem::Requirement
|
|
86
96
|
requirements:
|
|
87
|
-
- - ~>
|
|
97
|
+
- - "~>"
|
|
88
98
|
- !ruby/object:Gem::Version
|
|
89
|
-
version:
|
|
99
|
+
version: 3.1.0
|
|
90
100
|
type: :runtime
|
|
91
101
|
prerelease: false
|
|
92
102
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
103
|
requirements:
|
|
94
|
-
- - ~>
|
|
104
|
+
- - "~>"
|
|
95
105
|
- !ruby/object:Gem::Version
|
|
96
|
-
version:
|
|
106
|
+
version: 3.1.0
|
|
97
107
|
- !ruby/object:Gem::Dependency
|
|
98
108
|
name: rspec-mocks
|
|
99
109
|
requirement: !ruby/object:Gem::Requirement
|
|
100
110
|
requirements:
|
|
101
|
-
- - ~>
|
|
111
|
+
- - "~>"
|
|
102
112
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
113
|
+
version: 3.1.0
|
|
104
114
|
type: :runtime
|
|
105
115
|
prerelease: false
|
|
106
116
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
117
|
requirements:
|
|
108
|
-
- - ~>
|
|
118
|
+
- - "~>"
|
|
109
119
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
120
|
+
version: 3.1.0
|
|
111
121
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name: rspec-
|
|
122
|
+
name: rspec-support
|
|
113
123
|
requirement: !ruby/object:Gem::Requirement
|
|
114
124
|
requirements:
|
|
115
|
-
- -
|
|
125
|
+
- - "~>"
|
|
116
126
|
- !ruby/object:Gem::Version
|
|
117
|
-
version:
|
|
127
|
+
version: 3.1.0
|
|
118
128
|
type: :runtime
|
|
119
129
|
prerelease: false
|
|
120
130
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
131
|
requirements:
|
|
122
|
-
- -
|
|
132
|
+
- - "~>"
|
|
123
133
|
- !ruby/object:Gem::Version
|
|
124
|
-
version:
|
|
134
|
+
version: 3.1.0
|
|
125
135
|
- !ruby/object:Gem::Dependency
|
|
126
136
|
name: rake
|
|
127
137
|
requirement: !ruby/object:Gem::Requirement
|
|
128
138
|
requirements:
|
|
129
|
-
- - ~>
|
|
139
|
+
- - "~>"
|
|
130
140
|
- !ruby/object:Gem::Version
|
|
131
141
|
version: 10.0.0
|
|
132
142
|
type: :development
|
|
133
143
|
prerelease: false
|
|
134
144
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
145
|
requirements:
|
|
136
|
-
- - ~>
|
|
146
|
+
- - "~>"
|
|
137
147
|
- !ruby/object:Gem::Version
|
|
138
148
|
version: 10.0.0
|
|
139
149
|
- !ruby/object:Gem::Dependency
|
|
140
150
|
name: cucumber
|
|
141
151
|
requirement: !ruby/object:Gem::Requirement
|
|
142
152
|
requirements:
|
|
143
|
-
- - ~>
|
|
153
|
+
- - "~>"
|
|
144
154
|
- !ruby/object:Gem::Version
|
|
145
155
|
version: 1.3.5
|
|
146
156
|
type: :development
|
|
147
157
|
prerelease: false
|
|
148
158
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
159
|
requirements:
|
|
150
|
-
- - ~>
|
|
160
|
+
- - "~>"
|
|
151
161
|
- !ruby/object:Gem::Version
|
|
152
162
|
version: 1.3.5
|
|
153
163
|
- !ruby/object:Gem::Dependency
|
|
154
164
|
name: aruba
|
|
155
165
|
requirement: !ruby/object:Gem::Requirement
|
|
156
166
|
requirements:
|
|
157
|
-
- - ~>
|
|
167
|
+
- - "~>"
|
|
158
168
|
- !ruby/object:Gem::Version
|
|
159
|
-
version: 0.4
|
|
169
|
+
version: 0.5.4
|
|
160
170
|
type: :development
|
|
161
171
|
prerelease: false
|
|
162
172
|
version_requirements: !ruby/object:Gem::Requirement
|
|
163
173
|
requirements:
|
|
164
|
-
- - ~>
|
|
174
|
+
- - "~>"
|
|
165
175
|
- !ruby/object:Gem::Version
|
|
166
|
-
version: 0.4
|
|
167
|
-
- !ruby/object:Gem::Dependency
|
|
168
|
-
name: ZenTest
|
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
|
170
|
-
requirements:
|
|
171
|
-
- - ~>
|
|
172
|
-
- !ruby/object:Gem::Version
|
|
173
|
-
version: 4.9.5
|
|
174
|
-
type: :development
|
|
175
|
-
prerelease: false
|
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
-
requirements:
|
|
178
|
-
- - ~>
|
|
179
|
-
- !ruby/object:Gem::Version
|
|
180
|
-
version: 4.9.5
|
|
176
|
+
version: 0.5.4
|
|
181
177
|
- !ruby/object:Gem::Dependency
|
|
182
178
|
name: ammeter
|
|
183
179
|
requirement: !ruby/object:Gem::Requirement
|
|
184
180
|
requirements:
|
|
185
181
|
- - '='
|
|
186
182
|
- !ruby/object:Gem::Version
|
|
187
|
-
version:
|
|
183
|
+
version: 1.1.2
|
|
188
184
|
type: :development
|
|
189
185
|
prerelease: false
|
|
190
186
|
version_requirements: !ruby/object:Gem::Requirement
|
|
191
187
|
requirements:
|
|
192
188
|
- - '='
|
|
193
189
|
- !ruby/object:Gem::Version
|
|
194
|
-
version:
|
|
195
|
-
- !ruby/object:Gem::Dependency
|
|
196
|
-
name: capybara
|
|
197
|
-
requirement: !ruby/object:Gem::Requirement
|
|
198
|
-
requirements:
|
|
199
|
-
- - ! '>='
|
|
200
|
-
- !ruby/object:Gem::Version
|
|
201
|
-
version: 2.0.0
|
|
202
|
-
type: :development
|
|
203
|
-
prerelease: false
|
|
204
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
205
|
-
requirements:
|
|
206
|
-
- - ! '>='
|
|
207
|
-
- !ruby/object:Gem::Version
|
|
208
|
-
version: 2.0.0
|
|
190
|
+
version: 1.1.2
|
|
209
191
|
description: RSpec for Rails
|
|
210
|
-
email: rspec
|
|
192
|
+
email: rspec@googlegroups.com
|
|
211
193
|
executables: []
|
|
212
194
|
extensions: []
|
|
213
195
|
extra_rdoc_files: []
|
|
214
196
|
files:
|
|
215
|
-
-
|
|
197
|
+
- ".document"
|
|
198
|
+
- ".yardopts"
|
|
199
|
+
- Capybara.md
|
|
200
|
+
- Changelog.md
|
|
201
|
+
- License.txt
|
|
202
|
+
- README.md
|
|
216
203
|
- lib/generators/rspec.rb
|
|
217
204
|
- lib/generators/rspec/controller/controller_generator.rb
|
|
218
205
|
- lib/generators/rspec/controller/templates/controller_spec.rb
|
|
219
206
|
- lib/generators/rspec/controller/templates/view_spec.rb
|
|
207
|
+
- lib/generators/rspec/feature/feature_generator.rb
|
|
208
|
+
- lib/generators/rspec/feature/templates/feature_spec.rb
|
|
220
209
|
- lib/generators/rspec/helper/helper_generator.rb
|
|
221
210
|
- lib/generators/rspec/helper/templates/helper_spec.rb
|
|
222
211
|
- lib/generators/rspec/install/install_generator.rb
|
|
223
|
-
- lib/generators/rspec/install/templates
|
|
224
|
-
- lib/generators/rspec/install/templates/spec/spec_helper.rb.tt
|
|
212
|
+
- lib/generators/rspec/install/templates/spec/rails_helper.rb
|
|
225
213
|
- lib/generators/rspec/integration/integration_generator.rb
|
|
226
214
|
- lib/generators/rspec/integration/templates/request_spec.rb
|
|
215
|
+
- lib/generators/rspec/job/job_generator.rb
|
|
216
|
+
- lib/generators/rspec/job/templates/job_spec.rb.erb
|
|
227
217
|
- lib/generators/rspec/mailer/mailer_generator.rb
|
|
228
218
|
- lib/generators/rspec/mailer/templates/fixture
|
|
229
219
|
- lib/generators/rspec/mailer/templates/mailer_spec.rb
|
|
@@ -244,6 +234,7 @@ files:
|
|
|
244
234
|
- lib/rspec-rails.rb
|
|
245
235
|
- lib/rspec/rails.rb
|
|
246
236
|
- lib/rspec/rails/adapters.rb
|
|
237
|
+
- lib/rspec/rails/configuration.rb
|
|
247
238
|
- lib/rspec/rails/example.rb
|
|
248
239
|
- lib/rspec/rails/example/controller_example_group.rb
|
|
249
240
|
- lib/rspec/rails/example/feature_example_group.rb
|
|
@@ -255,57 +246,47 @@ files:
|
|
|
255
246
|
- lib/rspec/rails/example/routing_example_group.rb
|
|
256
247
|
- lib/rspec/rails/example/view_example_group.rb
|
|
257
248
|
- lib/rspec/rails/extensions.rb
|
|
258
|
-
- lib/rspec/rails/extensions/active_record/base.rb
|
|
259
249
|
- lib/rspec/rails/extensions/active_record/proxy.rb
|
|
250
|
+
- lib/rspec/rails/feature_check.rb
|
|
260
251
|
- lib/rspec/rails/fixture_support.rb
|
|
261
|
-
- lib/rspec/rails/infer_type_configuration.rb
|
|
262
252
|
- lib/rspec/rails/matchers.rb
|
|
263
253
|
- lib/rspec/rails/matchers/be_a_new.rb
|
|
264
254
|
- lib/rspec/rails/matchers/be_new_record.rb
|
|
265
255
|
- lib/rspec/rails/matchers/be_valid.rb
|
|
266
|
-
- lib/rspec/rails/matchers/
|
|
256
|
+
- lib/rspec/rails/matchers/have_http_status.rb
|
|
267
257
|
- lib/rspec/rails/matchers/have_rendered.rb
|
|
268
258
|
- lib/rspec/rails/matchers/redirect_to.rb
|
|
269
259
|
- lib/rspec/rails/matchers/relation_match_array.rb
|
|
270
260
|
- lib/rspec/rails/matchers/routing_matchers.rb
|
|
271
|
-
- lib/rspec/rails/mocks.rb
|
|
272
|
-
- lib/rspec/rails/module_inclusion.rb
|
|
273
261
|
- lib/rspec/rails/tasks/rspec.rake
|
|
274
262
|
- lib/rspec/rails/vendor/capybara.rb
|
|
275
|
-
- lib/rspec/rails/vendor/webrat.rb
|
|
276
263
|
- lib/rspec/rails/version.rb
|
|
277
264
|
- lib/rspec/rails/view_assigns.rb
|
|
278
265
|
- lib/rspec/rails/view_rendering.rb
|
|
279
|
-
- README.md
|
|
280
|
-
- License.txt
|
|
281
|
-
- Changelog.md
|
|
282
|
-
- Capybara.md
|
|
283
|
-
- .yardopts
|
|
284
|
-
- .document
|
|
285
266
|
homepage: http://github.com/rspec/rspec-rails
|
|
286
267
|
licenses:
|
|
287
268
|
- MIT
|
|
288
269
|
metadata: {}
|
|
289
270
|
post_install_message:
|
|
290
271
|
rdoc_options:
|
|
291
|
-
- --charset=UTF-8
|
|
272
|
+
- "--charset=UTF-8"
|
|
292
273
|
require_paths:
|
|
293
274
|
- lib
|
|
294
275
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
295
276
|
requirements:
|
|
296
|
-
- -
|
|
277
|
+
- - ">="
|
|
297
278
|
- !ruby/object:Gem::Version
|
|
298
279
|
version: '0'
|
|
299
280
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
281
|
requirements:
|
|
301
|
-
- -
|
|
282
|
+
- - ">="
|
|
302
283
|
- !ruby/object:Gem::Version
|
|
303
284
|
version: '0'
|
|
304
285
|
requirements: []
|
|
305
286
|
rubyforge_project: rspec
|
|
306
|
-
rubygems_version: 2.
|
|
287
|
+
rubygems_version: 2.2.2
|
|
307
288
|
signing_key:
|
|
308
289
|
specification_version: 4
|
|
309
|
-
summary: rspec-rails-
|
|
290
|
+
summary: rspec-rails-3.1.0
|
|
310
291
|
test_files: []
|
|
311
292
|
has_rdoc:
|
metadata.gz.sig
ADDED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
begin
|
|
2
|
-
require 'rspec/rails/autotest'
|
|
3
|
-
rescue LoadError
|
|
4
|
-
# (c) Copyright 2006 Nick Sieger <nicksieger@gmail.com>
|
|
5
|
-
#
|
|
6
|
-
# Permission is hereby granted, free of charge, to any person
|
|
7
|
-
# obtaining a copy of this software and associated documentation files
|
|
8
|
-
# (the "Software"), to deal in the Software without restriction,
|
|
9
|
-
# including without limitation the rights to use, copy, modify, merge,
|
|
10
|
-
# publish, distribute, sublicense, and/or sell copies of the Software,
|
|
11
|
-
# and to permit persons to whom the Software is furnished to do so,
|
|
12
|
-
# subject to the following conditions:
|
|
13
|
-
#
|
|
14
|
-
# The above copyright notice and this permission notice shall be
|
|
15
|
-
# included in all copies or substantial portions of the Software.
|
|
16
|
-
#
|
|
17
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
-
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
19
|
-
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20
|
-
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
21
|
-
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
22
|
-
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
23
|
-
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
24
|
-
# SOFTWARE.
|
|
25
|
-
|
|
26
|
-
$:.push(*Dir["vendor/rails/*/lib"])
|
|
27
|
-
|
|
28
|
-
require 'active_support'
|
|
29
|
-
require 'active_support/core_ext'
|
|
30
|
-
require 'autotest/rspec2'
|
|
31
|
-
|
|
32
|
-
class Autotest::RailsRspec2 < Autotest::Rspec2
|
|
33
|
-
|
|
34
|
-
def initialize
|
|
35
|
-
super
|
|
36
|
-
setup_rails_rspec2_mappings
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def setup_rails_rspec2_mappings
|
|
40
|
-
%w{coverage/ db/ doc/ log/ public/ script/ tmp/ vendor/rails vendor/plugins vendor/gems}.each do |exception|
|
|
41
|
-
add_exception(/^([\.\/]*)?#{exception}/)
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
clear_mappings
|
|
45
|
-
|
|
46
|
-
add_mapping(%r%^(test|spec)/fixtures/(.*).yml$%) { |_, m|
|
|
47
|
-
["spec/models/#{m[2].singularize}_spec.rb"] + files_matching(%r%^spec\/views\/#{m[2]}/.*_spec\.rb$%)
|
|
48
|
-
}
|
|
49
|
-
add_mapping(%r%^spec/.*_spec\.rb$%) { |filename, _|
|
|
50
|
-
filename
|
|
51
|
-
}
|
|
52
|
-
add_mapping(%r%^app/models/(.*)\.rb$%) { |_, m|
|
|
53
|
-
["spec/models/#{m[1]}_spec.rb"]
|
|
54
|
-
}
|
|
55
|
-
add_mapping(%r%^app/views/(.*)$%) { |_, m|
|
|
56
|
-
files_matching %r%^spec/views/#{m[1]}_spec.rb$%
|
|
57
|
-
}
|
|
58
|
-
add_mapping(%r%^app/controllers/(.*)\.rb$%) { |_, m|
|
|
59
|
-
if m[1] == "application"
|
|
60
|
-
files_matching %r%^spec/controllers/.*_spec\.rb$%
|
|
61
|
-
else
|
|
62
|
-
["spec/controllers/#{m[1]}_spec.rb"]
|
|
63
|
-
end
|
|
64
|
-
}
|
|
65
|
-
add_mapping(%r%^app/helpers/(.*)_helper\.rb$%) { |_, m|
|
|
66
|
-
if m[1] == "application" then
|
|
67
|
-
files_matching(%r%^spec/(views|helpers)/.*_spec\.rb$%)
|
|
68
|
-
else
|
|
69
|
-
["spec/helpers/#{m[1]}_helper_spec.rb"] + files_matching(%r%^spec\/views\/#{m[1]}/.*_spec\.rb$%)
|
|
70
|
-
end
|
|
71
|
-
}
|
|
72
|
-
add_mapping(%r%^config/routes\.rb$%) {
|
|
73
|
-
files_matching %r%^spec/(controllers|routing|views|helpers)/.*_spec\.rb$%
|
|
74
|
-
}
|
|
75
|
-
add_mapping(%r%^config/database\.yml$%) { |_, m|
|
|
76
|
-
files_matching %r%^spec/models/.*_spec\.rb$%
|
|
77
|
-
}
|
|
78
|
-
add_mapping(%r%^(spec/(spec_helper|support/.*)|config/(boot|environment(s/test)?))\.rb$%) {
|
|
79
|
-
files_matching %r%^spec/(models|controllers|routing|views|helpers)/.*_spec\.rb$%
|
|
80
|
-
}
|
|
81
|
-
add_mapping(%r%^lib/(.*)\.rb$%) { |_, m|
|
|
82
|
-
["spec/lib/#{m[1]}_spec.rb"]
|
|
83
|
-
}
|
|
84
|
-
add_mapping(%r%^app/mailers/(.*)\.rb$%) { |_, m|
|
|
85
|
-
["spec/mailers/#{m[1]}_spec.rb"]
|
|
86
|
-
}
|
|
87
|
-
end
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
Autotest.add_hook(:ran_command) { warn "\n\e[31mUsing the built in rspec-rails autotest support is deprecated and will be removed in RSpec 3. Please switch to the rspec-autotest gem\e[0m" }
|
|
91
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--color
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
module RSpec
|
|
2
|
-
module Rails
|
|
3
|
-
if defined?(ActiveRecord)
|
|
4
|
-
module Extensions
|
|
5
|
-
module ActiveRecord
|
|
6
|
-
# Extension to enhance `to have` on AR Model classes
|
|
7
|
-
#
|
|
8
|
-
# @example
|
|
9
|
-
#
|
|
10
|
-
# ModelClass.should have(:no).records
|
|
11
|
-
# ModelClass.should have(1).record
|
|
12
|
-
# ModelClass.should have(n).records
|
|
13
|
-
if ::ActiveRecord::VERSION::STRING >= '4'
|
|
14
|
-
def records
|
|
15
|
-
all.to_a
|
|
16
|
-
end
|
|
17
|
-
else
|
|
18
|
-
def records
|
|
19
|
-
find(:all)
|
|
20
|
-
end
|
|
21
|
-
end
|
|
22
|
-
alias :record :records
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
class ::ActiveRecord::Base
|
|
26
|
-
extend RSpec::Rails::Extensions::ActiveRecord
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
if defined?(::ActiveModel)
|
|
34
|
-
module ::ActiveModel::Validations
|
|
35
|
-
# Extension to enhance `to have` on AR Model instances. Calls
|
|
36
|
-
# model.valid? in order to prepare the object's errors object. Accepts
|
|
37
|
-
# a :context option to specify the validation context.
|
|
38
|
-
#
|
|
39
|
-
# You can also use this to specify the content of the error messages.
|
|
40
|
-
#
|
|
41
|
-
# @example
|
|
42
|
-
#
|
|
43
|
-
# expect(model).to have(:no).errors_on(:attribute)
|
|
44
|
-
# expect(model).to have(1).error_on(:attribute)
|
|
45
|
-
# expect(model).to have(n).errors_on(:attribute)
|
|
46
|
-
# expect(model).to have(n).errors_on(:attribute, :context => :create)
|
|
47
|
-
#
|
|
48
|
-
# expect(model.errors_on(:attribute)).to include("can't be blank")
|
|
49
|
-
def errors_on(attribute, options = {})
|
|
50
|
-
valid_args = [options[:context]].compact
|
|
51
|
-
self.valid?(*valid_args)
|
|
52
|
-
|
|
53
|
-
[self.errors[attribute]].flatten.compact
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
alias :error_on :errors_on
|
|
57
|
-
end
|
|
58
|
-
end
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
RSpec.configure do |config|
|
|
2
|
-
def config.infer_spec_type_from_file_location!
|
|
3
|
-
@infer_spec_type_from_file_location = true
|
|
4
|
-
end
|
|
5
|
-
|
|
6
|
-
def config.infer_spec_type_from_file_location?
|
|
7
|
-
@infer_spec_type_from_file_location ||= false
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
config.before do
|
|
11
|
-
unless config.infer_spec_type_from_file_location?
|
|
12
|
-
RSpec.warn_deprecation(<<-EOS.gsub(/^\s+\|/,''))
|
|
13
|
-
|rspec-rails 3 will no longer automatically infer an example group's spec type
|
|
14
|
-
|from the file location. You can explicitly opt-in to this feature using this
|
|
15
|
-
|snippet:
|
|
16
|
-
|
|
|
17
|
-
|RSpec.configure do |config|
|
|
18
|
-
| config.infer_spec_type_from_file_location!
|
|
19
|
-
|end
|
|
20
|
-
|
|
|
21
|
-
|If you wish to manually label spec types via metadata you can safely ignore
|
|
22
|
-
|this warning and continue upgrading to RSpec 3 without addressing it.
|
|
23
|
-
EOS
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
end
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
require 'active_support'
|
|
2
|
-
require 'active_support/core_ext/module/aliasing'
|
|
3
|
-
require 'rspec/matchers/built_in/have'
|
|
4
|
-
|
|
5
|
-
module RSpec::Rails::Matchers
|
|
6
|
-
module HaveExtensions
|
|
7
|
-
extend ActiveSupport::Concern
|
|
8
|
-
|
|
9
|
-
# @api private
|
|
10
|
-
#
|
|
11
|
-
# Enhances the failure message for `should have(n)` matchers
|
|
12
|
-
def failure_message_for_should_with_errors_on_extensions
|
|
13
|
-
return "expected #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}, got #{@actual}" if @collection_name == :errors_on
|
|
14
|
-
return "expected #{relativities[@relativity]}#{@expected} error on :#{@args[0]}, got #{@actual}" if @collection_name == :error_on
|
|
15
|
-
return failure_message_for_should_without_errors_on_extensions
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
# @api private
|
|
19
|
-
#
|
|
20
|
-
# Enhances the description for `should have(n)` matchers
|
|
21
|
-
def description_with_errors_on_extensions
|
|
22
|
-
return "have #{relativities[@relativity]}#{@expected} errors on :#{@args[0]}" if @collection_name == :errors_on
|
|
23
|
-
return "have #{relativities[@relativity]}#{@expected} error on :#{@args[0]}" if @collection_name == :error_on
|
|
24
|
-
return description_without_errors_on_extensions
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
included do
|
|
28
|
-
alias_method_chain :failure_message_for_should, :errors_on_extensions
|
|
29
|
-
alias_method_chain :description, :errors_on_extensions
|
|
30
|
-
end
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
RSpec::Matchers::BuiltIn::Have.class_eval do
|
|
35
|
-
include RSpec::Rails::Matchers::HaveExtensions
|
|
36
|
-
end
|