rspec-rails 3.2.1 → 3.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Changelog.md +12 -0
- data/lib/rspec-rails.rb +37 -20
- data/lib/rspec/rails/adapters.rb +15 -2
- data/lib/rspec/rails/configuration.rb +10 -1
- data/lib/rspec/rails/example/view_example_group.rb +1 -1
- data/lib/rspec/rails/feature_check.rb +5 -0
- data/lib/rspec/rails/version.rb +1 -1
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32d2e246a1000916e4c0eeaa3e5df27115c0d253
|
4
|
+
data.tar.gz: feed9967eb41264226b18f21ca7068ae1a35bed7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3d482989d7aad1d9fe4a100513bae38b38972bf45f5c165717d3bd8b6fca0b4e3522df43c3c151d099821b1677cc782c77be6d067612d52d8ca15370ceced03
|
7
|
+
data.tar.gz: e523716b7ec418eb786f638e9c91dd0f0b671bdfe20e7b3d1836b3ca5dfaf459585bbdf7ebb83d6a4fd408751e44ba1b494c7e10ac59cb988ad2d4581caf64a3
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
### 3.2.2 / 2015-06-03
|
2
|
+
|
3
|
+
Bug Fixes:
|
4
|
+
|
5
|
+
* Fix auto-including of generic `Helper` object for view specs sitting in the
|
6
|
+
`app/views` root (David Daniell, #1289)
|
7
|
+
* Remove pre-loading of ActionMailer in the Railtie (Aaron Kromer, #1327)
|
8
|
+
* Fix undefined method `need_auto_run=` error when using Ruby 2.1 and Rails 3.2
|
9
|
+
without the test-unit gem (Orien Madgwick, #1350)
|
10
|
+
* Fix load order issued which causes an undefined method `fixture_path` error
|
11
|
+
when loading rspec-rails after a spec has been created. (Aaron Kromer, #1372)
|
12
|
+
|
1
13
|
### 3.2.1 / 2015-02-23
|
2
14
|
[Full Changelog](http://github.com/rspec/rspec-rails/compare/v3.2.0...v3.2.1)
|
3
15
|
|
data/lib/rspec-rails.rb
CHANGED
@@ -23,28 +23,45 @@ module RSpec
|
|
23
23
|
# sets the default for the `preview_path`
|
24
24
|
initializer "rspec_rails.action_mailer",
|
25
25
|
:before => "action_mailer.set_configs" do |app|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
26
|
+
setup_preview_path(app)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def setup_preview_path(app)
|
32
|
+
# If the action mailer railtie isn't loaded the config will not respond
|
33
|
+
return unless supports_action_mailer_previews?(app.config)
|
34
|
+
options = app.config.action_mailer
|
35
|
+
config_default_preview_path(options) if config_preview_path?(options)
|
36
|
+
end
|
37
|
+
|
38
|
+
def config_preview_path?(options)
|
39
|
+
# This string version check avoids loading the ActionMailer class, as
|
40
|
+
# would happen using `defined?`. This is necessary because the
|
41
|
+
# ActionMailer class only loads it's settings once, at load time. If we
|
42
|
+
# load the class now any settings declared in a config block in an
|
43
|
+
# initializer will be ignored.
|
44
|
+
#
|
45
|
+
# We cannot use `respond_to?(:show_previews)` here as it will always
|
46
|
+
# return `true`.
|
47
|
+
if ::Rails::VERSION::STRING < '4.2'
|
48
|
+
::Rails.env.development?
|
49
|
+
elsif options.show_previews.nil?
|
50
|
+
options.show_previews = ::Rails.env.development?
|
51
|
+
else
|
52
|
+
options.show_previews
|
46
53
|
end
|
47
54
|
end
|
55
|
+
|
56
|
+
def config_default_preview_path(options)
|
57
|
+
return unless options.preview_path.blank?
|
58
|
+
options.preview_path = "#{::Rails.root}/spec/mailers/previews"
|
59
|
+
end
|
60
|
+
|
61
|
+
def supports_action_mailer_previews?(config)
|
62
|
+
config.respond_to?(:action_mailer) &&
|
63
|
+
config.action_mailer.respond_to?(:preview_path)
|
64
|
+
end
|
48
65
|
end
|
49
66
|
end
|
50
67
|
end
|
data/lib/rspec/rails/adapters.rb
CHANGED
@@ -5,6 +5,19 @@ require 'active_support/core_ext/string'
|
|
5
5
|
|
6
6
|
module RSpec
|
7
7
|
module Rails
|
8
|
+
def self.disable_testunit_autorun
|
9
|
+
# `Test::Unit::AutoRunner.need_auto_run=` was introduced to the test-unit
|
10
|
+
# gem in version 2.4.9. Previous to this version `Test::Unit.run=` was
|
11
|
+
# used. The implementation of test-unit included with Ruby has neither
|
12
|
+
# method.
|
13
|
+
if defined?(Test::Unit::AutoRunner.need_auto_run = ())
|
14
|
+
Test::Unit::AutoRunner.need_auto_run = false
|
15
|
+
elsif defined?(Test::Unit.run = ())
|
16
|
+
Test::Unit.run = false
|
17
|
+
end
|
18
|
+
end
|
19
|
+
private_class_method :disable_testunit_autorun
|
20
|
+
|
8
21
|
if ::Rails::VERSION::STRING >= '4.1.0'
|
9
22
|
if defined?(Kernel.gem)
|
10
23
|
gem 'minitest'
|
@@ -37,7 +50,7 @@ module RSpec
|
|
37
50
|
# date). If so, we turn the auto runner off.
|
38
51
|
require 'test/unit'
|
39
52
|
require 'test/unit/assertions'
|
40
|
-
|
53
|
+
disable_testunit_autorun
|
41
54
|
rescue LoadError => e
|
42
55
|
raise LoadError, <<-ERR.squish, e.backtrace
|
43
56
|
Ruby 2.2+ has removed test/unit from the core library. Rails
|
@@ -62,7 +75,7 @@ module RSpec
|
|
62
75
|
require 'test/unit/assertions'
|
63
76
|
end
|
64
77
|
# Turn off test unit's auto runner for those using the gem
|
65
|
-
|
78
|
+
disable_testunit_autorun
|
66
79
|
# Constant aliased to either Minitest or TestUnit, depending on what is
|
67
80
|
# loaded.
|
68
81
|
Assertions = Test::Unit::Assertions
|
@@ -56,12 +56,21 @@ module RSpec
|
|
56
56
|
config.add_setting :infer_base_class_for_anonymous_controllers, :default => true
|
57
57
|
|
58
58
|
# fixture support
|
59
|
-
config.include RSpec::Rails::FixtureSupport
|
60
59
|
config.add_setting :use_transactional_fixtures, :alias_with => :use_transactional_examples
|
61
60
|
config.add_setting :use_instantiated_fixtures
|
62
61
|
config.add_setting :global_fixtures
|
63
62
|
config.add_setting :fixture_path
|
64
63
|
|
64
|
+
# TODO: We'll need to create a deprecated module in order to properly
|
65
|
+
# report to gems / projects which are relying on this being loaded
|
66
|
+
# globally.
|
67
|
+
#
|
68
|
+
# See rspec/rspec-rails#1355 for history
|
69
|
+
#
|
70
|
+
# @deprecated Include `RSpec::Rails::RailsExampleGroup` or
|
71
|
+
# `RSpec::Rails::FixtureSupport` directly instead
|
72
|
+
config.include RSpec::Rails::FixtureSupport
|
73
|
+
|
65
74
|
# This allows us to expose `render_views` as a config option even though it
|
66
75
|
# breaks the convention of other options by using `render_views` as a
|
67
76
|
# command (i.e. `render_views = true`), where it would normally be used
|
@@ -14,7 +14,7 @@ module RSpec
|
|
14
14
|
module ClassMethods
|
15
15
|
def _default_helper
|
16
16
|
base = metadata[:description].split('/')[0..-2].join('/')
|
17
|
-
(base.camelize + 'Helper').constantize
|
17
|
+
(base.camelize + 'Helper').constantize unless base.to_s.empty?
|
18
18
|
rescue NameError
|
19
19
|
nil
|
20
20
|
end
|
@@ -38,6 +38,11 @@ module RSpec
|
|
38
38
|
has_action_mailer? && defined?(::ActionMailer::Preview)
|
39
39
|
end
|
40
40
|
|
41
|
+
def has_action_mailer_show_preview?
|
42
|
+
has_action_mailer_preview? &&
|
43
|
+
::ActionMailer::Base.respond_to?(:show_previews=)
|
44
|
+
end
|
45
|
+
|
41
46
|
def has_1_9_hash_syntax?
|
42
47
|
::Rails::VERSION::STRING > '4.0'
|
43
48
|
end
|
data/lib/rspec/rails/version.rb
CHANGED
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.2.
|
4
|
+
version: 3.2.2
|
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: 2015-
|
47
|
+
date: 2015-06-03 00:00:00.000000000 Z
|
48
48
|
dependencies:
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: activesupport
|
@@ -316,9 +316,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
316
|
version: '0'
|
317
317
|
requirements: []
|
318
318
|
rubyforge_project: rspec
|
319
|
-
rubygems_version: 2.
|
319
|
+
rubygems_version: 2.2.2
|
320
320
|
signing_key:
|
321
321
|
specification_version: 4
|
322
|
-
summary: rspec-rails-3.2.
|
322
|
+
summary: rspec-rails-3.2.2
|
323
323
|
test_files: []
|
324
324
|
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|