rspec-rails 3.9.1 → 4.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e9f2c32e485cc9a8f4a31f258f14873973ed1319ecb7061f35d3f6715c7df95
4
- data.tar.gz: a8ff832abfde3703a2925a27e4918ff38b1a736dffb973e621ce2b4089fc1cab
3
+ metadata.gz: b1f9c4fb5342bf765774bbd2bed6d51eede79c802c1ee044a1ba1f55b4bfcfd4
4
+ data.tar.gz: 86ac262e680b17cdc29f2735ad5667655c83a8aa0a9fe680a7a39bc158f5d09f
5
5
  SHA512:
6
- metadata.gz: cc09740e2221463f43d22b46a02623ed7ddab24f6069e9e2d844ee87e0eec53221bdbdac1754b3e220ea6b010a6c664f07a28eb935b0bf6909d8b0c2e19b0acc
7
- data.tar.gz: 7721bf098cc90a53aa3c070231e225bd1d2b45f4eef9f11e520a249bc16b98e99e3eb040f7e6ccdaeeb4ea8423abeae8dc8de3953dd68c12cb901c85573fc7e6
6
+ metadata.gz: 1de2f6233f642593ae5be6705a31272ebc75de0a020cb11629ff7797e377d12fc79c3a879fe324686ee9e7dbc1894deb8fa6566a52ed6d95f8f93d1d2e1d50bd
7
+ data.tar.gz: dd509156b5951df986c555d4ada95d303631a6099f477c82973c0ae0adf0587e82e5ed6f79f672bacb6584f42cc1f783fe3af10c67bcc39cf3b97e6155a4cf94
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,39 +1,46 @@
1
- ### 3.9.1 / 2020-03-10
2
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.9.0...v3.9.1)
1
+ ### 4.0 Development
2
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/master...4-0-dev)
3
+
4
+ Enhancements:
5
+
6
+ * Adds support for JRuby on Rails 5.2 and 6
3
7
 
4
8
  Bug Fixes:
5
9
 
6
- * Add missing require for have_enqueued_mail matcher. (Ignatius Reza, #2117)
10
+ * `EmptyTemplateHandler.call` now needs to support an additional argument in
11
+ Rails 6. (Pavel Rosický, #2089)
12
+ * Suppress warning from `SQLite3Adapter.represent_boolean_as_integer` which is
13
+ deprecated. (Pavel Rosický, #2092)
14
+ * `ActionView::Template#formats` has been deprecated and replaced by
15
+ `ActionView::Template#format`(Seb Jacobs, #2100)
7
16
 
8
- ### 3.9.0 / 2019-10-08
9
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.8.2...v3.9.0)
17
+ Breaking Changes:
10
18
 
11
- Enhancements
19
+ * Drops support for Rails below 5.0
20
+ * Drops support for Ruby below 2.3
12
21
 
13
- * Use `__dir__` instead of `__FILE__` in generated `rails_helper.rb` where
14
- supported. (OKURA Masafumi, #2048)
15
- * Add `have_enqueued` matcher as a "super" matcher to the `ActiveJob` matchers
16
- making it easier to match on `ActiveJob` delivered emails. (Joel Lubrano, #2047)
17
- * Add generator for system specs on Rails 5.1 and above. (Andrzej Sliwa, #1933)
18
- * Add generator for generator specs. (@ConSou, #2085)
19
- * Add option to generate routes when generating controller specs. (David Revelo, #2134)
22
+ ### Development
23
+ [Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.8.2...master)
20
24
 
21
25
  Bug Fixes:
22
26
 
23
27
  * Make the `ActiveJob` matchers fail when multiple jobs are queued for negated
24
28
  matches. e.g. `expect { job; job; }.to_not have_enqueued_job.
25
29
  (Emric Istanful, #2069)
26
-
27
- ### 3.8.3 / 2019-10-03
28
- [Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.8.2...master)
29
-
30
- Bug Fixes:
31
-
32
30
  * Namespaced fixtures now generate a `/` seperated path rather than an `_`.
33
31
  (@nxlith, #2077)
34
32
  * Check the arity of `errors` before attempting to use it to generate the `be_valid`
35
33
  error message. (Kevin Kuchta, #2096)
36
34
 
35
+ Enhancements
36
+
37
+ * Use `__dir__` instead of `__FILE__` in generated `rails_helper.rb` where
38
+ supported. (OKURA Masafumi, #2048)
39
+ * Add `have_enqueued` matcher as a "super" matcher to the `ActiveJob` matchers
40
+ making it easier to match on `ActiveJob` delivered emails. (Joel Lubrano, #2047)
41
+ * Add generator for system specs on Rails 5.1 and above. (Andrzej Sliwa, #1933)
42
+ * Add generator for generator specs. (@ConSou, #2085)
43
+
37
44
  ### 3.8.2 / 2019-01-13
38
45
  [Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.8.1...v3.8.2)
39
46
 
data/README.md CHANGED
@@ -12,7 +12,7 @@ Use **[`rspec-rails` 1.x][]** for Rails 2.x.
12
12
 
13
13
  [Build Status]: https://secure.travis-ci.org/rspec/rspec-rails.svg?branch=master
14
14
  [travis-ci]: https://travis-ci.org/rspec/rspec-rails
15
- [Code Climate]: https://codeclimate.com/github/rspec/rspec-rails.svg
15
+ [Code Climate]: https://img.shields.io/codeclimate/github/rspec/rspec-rails.svg
16
16
  [code-climate]: https://codeclimate.com/github/rspec/rspec-rails
17
17
  [Gem Version]: https://badge.fury.io/rb/rspec-rails.svg
18
18
  [gem-version]: https://badge.fury.io/rb/rspec-rails
@@ -28,7 +28,7 @@ Use **[`rspec-rails` 1.x][]** for Rails 2.x.
28
28
  ```ruby
29
29
  # Run against the latest stable release
30
30
  group :development, :test do
31
- gem 'rspec-rails', '~> 3.9'
31
+ gem 'rspec-rails', '~> 3.8'
32
32
  end
33
33
 
34
34
  # Or, run against the master branch
@@ -20,6 +20,7 @@ module Rspec
20
20
 
21
21
  def generate_preview_files
22
22
  return unless RSpec::Rails::FeatureCheck.has_action_mailer_preview?
23
+
23
24
  template "preview.rb", File.join("spec/mailers/previews", class_path, "#{file_name}_preview.rb")
24
25
  end
25
26
  end
@@ -23,6 +23,7 @@ module Rspec
23
23
 
24
24
  def create_fixture_file
25
25
  return unless missing_fixture_replacement?
26
+
26
27
  template 'fixtures.yml', File.join('spec/fixtures', class_path, "#{(pluralize_table_names? ? plural_file_name : file_name)}.yml")
27
28
  end
28
29
 
@@ -4,7 +4,7 @@ module Rspec
4
4
  module Generators
5
5
  # @private
6
6
  class RequestGenerator < IntegrationGenerator
7
- source_paths << File.expand_path("../../integration/templates", __FILE__)
7
+ source_paths << File.expand_path('../integration/templates', __dir__)
8
8
  end
9
9
  end
10
10
  end
@@ -6,7 +6,7 @@ module Rspec
6
6
  # @private
7
7
  class ScaffoldGenerator < Base
8
8
  include ::Rails::Generators::ResourceHelpers
9
- source_paths << File.expand_path("../../helper/templates", __FILE__)
9
+ source_paths << File.expand_path('../helper/templates', __dir__)
10
10
  argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"
11
11
 
12
12
  class_option :orm, :desc => "ORM used to generate the controller"
@@ -74,12 +74,14 @@ module Rspec
74
74
  # support for namespaced-resources
75
75
  def ns_file_name
76
76
  return file_name if ns_parts.empty?
77
+
77
78
  "#{ns_prefix.map(&:underscore).join('/')}_#{ns_suffix.singularize.underscore}"
78
79
  end
79
80
 
80
81
  # support for namespaced-resources
81
82
  def ns_table_name
82
83
  return table_name if ns_parts.empty?
84
+
83
85
  "#{ns_prefix.map(&:underscore).join('/')}/#{ns_suffix.tableize}"
84
86
  end
85
87
 
@@ -39,6 +39,7 @@ module RSpec
39
39
 
40
40
  def setup_preview_path(app)
41
41
  return unless supports_action_mailer_previews?(app.config)
42
+
42
43
  options = app.config.action_mailer
43
44
  config_default_preview_path(options) if config_preview_path?(options)
44
45
  end
@@ -57,6 +58,7 @@ module RSpec
57
58
 
58
59
  def config_default_preview_path(options)
59
60
  return unless options.preview_path.blank?
61
+
60
62
  options.preview_path = "#{::Rails.root}/spec/mailers/previews"
61
63
  end
62
64
 
@@ -103,6 +103,7 @@ module RSpec
103
103
  assertion_modules.each do |mod|
104
104
  mod.public_instance_methods.each do |method|
105
105
  next if method == :method_missing || method == "method_missing"
106
+
106
107
  define_method(method.to_sym) do |*args, &block|
107
108
  assertion_instance.send(method.to_sym, *args, &block)
108
109
  end
@@ -19,6 +19,7 @@ module RSpec
19
19
  else
20
20
  def determine_default_helper_class(_ignore)
21
21
  return unless Module === described_class && !(Class === described_class)
22
+
22
23
  described_class
23
24
  end
24
25
  end
@@ -49,9 +49,7 @@ module RSpec
49
49
  begin
50
50
  require 'capybara'
51
51
  require 'action_dispatch/system_test_case'
52
- # rubocop:disable Lint/HandleExceptions
53
52
  rescue LoadError => e
54
- # rubocop:enable Lint/HandleExceptions
55
53
  abort """
56
54
  LoadError: #{e.message}
57
55
  System test integration requires Rails >= 5.1 and has a hard
@@ -1,13 +1,8 @@
1
1
  module RSpec
2
2
  module Rails
3
3
  # @private
4
- # Disable some cops until https://github.com/bbatsov/rubocop/issues/1310
5
- # rubocop:disable Style/IndentationConsistency
6
4
  module FeatureCheck
7
- # rubocop:disable Style/IndentationWidth
8
- module_function
9
- # rubocop:enable Style/IndentationWidth
10
-
5
+ module_function
11
6
  def can_check_pending_migrations?
12
7
  has_active_record_migration? &&
13
8
  ::ActiveRecord::Migration.respond_to?(:check_pending!)
@@ -59,6 +54,5 @@ module RSpec
59
54
  end
60
55
  end
61
56
  end
62
- # rubocop:enable Style/IndentationConsistency
63
57
  end
64
58
  end
@@ -22,5 +22,4 @@ require 'rspec/rails/matchers/be_valid'
22
22
  require 'rspec/rails/matchers/have_http_status'
23
23
  if RSpec::Rails::FeatureCheck.has_active_job?
24
24
  require 'rspec/rails/matchers/active_job'
25
- require 'rspec/rails/matchers/have_enqueued_mail'
26
25
  end
@@ -310,6 +310,7 @@ module RSpec
310
310
  # @private
311
311
  def check_active_job_adapter
312
312
  return if ::ActiveJob::QueueAdapters::TestAdapter === ::ActiveJob::Base.queue_adapter
313
+
313
314
  raise StandardError, "To use ActiveJob matchers set `ActiveJob::Base.queue_adapter = :test`"
314
315
  end
315
316
  end
@@ -114,6 +114,7 @@ module RSpec
114
114
 
115
115
  def assert_ivars(*expected_ivars)
116
116
  return unless (expected_ivars - present_ivars).any?
117
+
117
118
  ivar_list = RSpec::Matchers::EnglishPhrasing.list(expected_ivars)
118
119
  raise "#{self.class.name} needs to supply#{ivar_list}"
119
120
  end
@@ -6,7 +6,6 @@ module RSpec
6
6
  module Matchers
7
7
  # Matcher class for `have_enqueued_mail`. Should not be instantiated directly.
8
8
  #
9
- # rubocop: disable Style/ClassLength
10
9
  # @private
11
10
  # @see RSpec::Rails::Matchers#have_enqueued_mail
12
11
  class HaveEnqueuedMail < ActiveJob::HaveEnqueuedJob
@@ -33,6 +32,7 @@ module RSpec
33
32
 
34
33
  def matches?(block)
35
34
  raise ArgumentError, 'have_enqueued_mail and enqueue_mail only work with block arguments' unless block.respond_to?(:call)
35
+
36
36
  check_active_job_adapter
37
37
  super
38
38
  end
@@ -89,6 +89,7 @@ module RSpec
89
89
 
90
90
  def check_active_job_adapter
91
91
  return if ::ActiveJob::QueueAdapters::TestAdapter === ::ActiveJob::Base.queue_adapter
92
+
92
93
  raise StandardError, "To use HaveEnqueuedMail matcher set `ActiveJob::Base.queue_adapter = :test`"
93
94
  end
94
95
 
@@ -124,8 +125,6 @@ module RSpec
124
125
  ActionMailer::DeliveryJob
125
126
  end
126
127
  end
127
- # rubocop: enable Style/ClassLength
128
-
129
128
  # @api public
130
129
  # Passes if an email has been enqueued inside block.
131
130
  # May chain with to specify expected arguments.
@@ -59,6 +59,7 @@ module RSpec
59
59
  # `@invalid_response` is present, `nil` otherwise
60
60
  def invalid_response_type_message
61
61
  return unless @invalid_response
62
+
62
63
  "expected a response object, but an instance of " \
63
64
  "#{@invalid_response.class} was received"
64
65
  end
@@ -174,6 +175,7 @@ module RSpec
174
175
  # @return [Symbol] representing the actual http numeric code
175
176
  def actual_status
176
177
  return unless actual
178
+
177
179
  @actual_status ||= compute_status_from(actual)
178
180
  end
179
181
 
@@ -254,6 +256,7 @@ module RSpec
254
256
  unless self.class.valid_statuses.include?(type)
255
257
  raise ArgumentError, "Invalid generic HTTP status: #{type.inspect}"
256
258
  end
259
+
257
260
  @expected = type
258
261
  @actual = nil
259
262
  @invalid_response = nil
@@ -374,6 +377,7 @@ module RSpec
374
377
  # @see https://github.com/rack/rack/blob/master/lib/rack/utils.rb `Rack::Utils::SYMBOL_TO_STATUS_CODE`
375
378
  def have_http_status(target)
376
379
  raise ArgumentError, "Invalid HTTP status: nil" unless target
380
+
377
381
  HaveHttpStatus.matcher_for_status(target)
378
382
  end
379
383
  end
@@ -29,6 +29,7 @@ module RSpec
29
29
  def check_redirect
30
30
  response = @scope.response
31
31
  return unless response.respond_to?(:redirect?) && response.redirect?
32
+
32
33
  @redirect_is = @scope.send(:normalize_argument_to_redirection, response.location)
33
34
  end
34
35
 
@@ -3,7 +3,7 @@ module RSpec
3
3
  # Version information for RSpec Rails.
4
4
  module Version
5
5
  # Current version of RSpec Rails, in semantic versioning format.
6
- STRING = '3.9.1'
6
+ STRING = '4.0.0.beta2'
7
7
  end
8
8
  end
9
9
  end
@@ -56,11 +56,22 @@ module RSpec
56
56
  template.identifier,
57
57
  EmptyTemplateHandler,
58
58
  :virtual_path => template.virtual_path,
59
- :format => template.formats
59
+ :format => template_format(template),
60
+ :locals => []
60
61
  )
61
62
  end
62
63
  end
63
64
 
65
+ if ::Rails::VERSION::STRING >= '6'
66
+ def self.template_format(template)
67
+ template.format
68
+ end
69
+ else
70
+ def self.template_format(template)
71
+ template.formats
72
+ end
73
+ end
74
+
64
75
  # Delegates all methods to the submitted resolver and for all methods
65
76
  # that return a collection of `ActionView::Template` instances, return
66
77
  # templates with modified source
@@ -91,7 +102,7 @@ module RSpec
91
102
  #
92
103
  # @private
93
104
  class FileSystemResolver < ::ActionView::FileSystemResolver
94
- private
105
+ private
95
106
 
96
107
  def find_templates(*args)
97
108
  templates = super
@@ -102,7 +113,7 @@ module RSpec
102
113
 
103
114
  # @private
104
115
  class EmptyTemplateHandler
105
- def self.call(_template)
116
+ def self.call(_template, _source = nil)
106
117
  ::Rails.logger.info(" Template rendering was prevented by rspec-rails. Use `render_views` to verify rendered view contents if necessary.")
107
118
 
108
119
  %("")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.1
4
+ version: 4.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chelimsky
@@ -44,7 +44,7 @@ cert_chain:
44
44
  ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
45
45
  F3MdtaDehhjC
46
46
  -----END CERTIFICATE-----
47
- date: 2020-03-10 00:00:00.000000000 Z
47
+ date: 2019-04-26 00:00:00.000000000 Z
48
48
  dependencies:
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: activesupport
@@ -52,98 +52,98 @@ dependencies:
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '3.0'
55
+ version: '4.2'
56
56
  type: :runtime
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: '3.0'
62
+ version: '4.2'
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: actionpack
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: '3.0'
69
+ version: '4.2'
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: '3.0'
76
+ version: '4.2'
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: railties
79
79
  requirement: !ruby/object:Gem::Requirement
80
80
  requirements:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: '3.0'
83
+ version: '4.2'
84
84
  type: :runtime
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
- version: '3.0'
90
+ version: '4.2'
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec-core
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 3.9.0
97
+ version: '3.8'
98
98
  type: :runtime
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: 3.9.0
104
+ version: '3.8'
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: rspec-expectations
107
107
  requirement: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: 3.9.0
111
+ version: '3.8'
112
112
  type: :runtime
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: 3.9.0
118
+ version: '3.8'
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: rspec-mocks
121
121
  requirement: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: 3.9.0
125
+ version: '3.8'
126
126
  type: :runtime
127
127
  prerelease: false
128
128
  version_requirements: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: 3.9.0
132
+ version: '3.8'
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: rspec-support
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: 3.9.0
139
+ version: '3.8'
140
140
  type: :runtime
141
141
  prerelease: false
142
142
  version_requirements: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: 3.9.0
146
+ version: '3.8'
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: cucumber
149
149
  requirement: !ruby/object:Gem::Requirement
@@ -164,14 +164,14 @@ dependencies:
164
164
  requirements:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
- version: 0.14.12
167
+ version: 0.5.4
168
168
  type: :development
169
169
  prerelease: false
170
170
  version_requirements: !ruby/object:Gem::Requirement
171
171
  requirements:
172
172
  - - "~>"
173
173
  - !ruby/object:Gem::Version
174
- version: 0.14.12
174
+ version: 0.5.4
175
175
  - !ruby/object:Gem::Dependency
176
176
  name: ammeter
177
177
  requirement: !ruby/object:Gem::Requirement
@@ -186,7 +186,7 @@ dependencies:
186
186
  - - "~>"
187
187
  - !ruby/object:Gem::Version
188
188
  version: 1.1.2
189
- description: rspec-rails is a testing framework for Rails 3+.
189
+ description: rspec-rails is a testing framework for Rails 4+.
190
190
  email: rspec@googlegroups.com
191
191
  executables: []
192
192
  extensions: []
@@ -284,7 +284,7 @@ licenses:
284
284
  - MIT
285
285
  metadata:
286
286
  bug_tracker_uri: https://github.com/rspec/rspec-rails/issues
287
- changelog_uri: https://github.com/rspec/rspec-rails/blob/v3.9.1/Changelog.md
287
+ changelog_uri: https://github.com/rspec/rspec-rails/blob/v4.0.0.beta2/Changelog.md
288
288
  documentation_uri: https://rspec.info/documentation/
289
289
  mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
290
290
  source_code_uri: https://github.com/rspec/rspec-rails
@@ -300,11 +300,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
300
300
  version: '0'
301
301
  required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  requirements:
303
- - - ">="
303
+ - - ">"
304
304
  - !ruby/object:Gem::Version
305
- version: '0'
305
+ version: 1.3.1
306
306
  requirements: []
307
- rubygems_version: 3.1.2
307
+ rubygems_version: 3.0.3
308
308
  signing_key:
309
309
  specification_version: 4
310
310
  summary: RSpec for Rails
metadata.gz.sig CHANGED
Binary file