guard-rspec 4.1.1 → 4.2.0

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
  SHA1:
3
- metadata.gz: b840e30faa33f7d3e72edeba72df635465659a25
4
- data.tar.gz: 6e2405b9115ba801d41336812a58384b62d562ba
3
+ metadata.gz: 78a6216c767a81fd752d3fecc99f78f38f47cb04
4
+ data.tar.gz: 4240ebc525a5e712b46b7e9f931b79e9fe41be1d
5
5
  SHA512:
6
- metadata.gz: c4b4c26dd6d7003bc375fe6f459a4fae2e2eecd563741d3ef32c9c56c8756f2b3b8b7dd2071b8b5d862c3ffb91c1024b042314c7e7e0c90266ac1a05a27e0470
7
- data.tar.gz: b26ddf31ed85e46cc85a692d24daa1955169097b30321b6ae3090ad60f7918e9004c307228b422cb74c399e912229db3a435192cab80f9ca9051a0bc176a76fc
6
+ metadata.gz: c54f4f6d999c2a57ffe788b543e0f3415d5f5401a782b6d0965982c7ec8cc8e4ec67a294150f9d11cb60612df17426052624d50a10590e8fde99dba178541a1f
7
+ data.tar.gz: 67fcc174e3168a918490d1e15a16b74d568f305da8f8b1afb514e856accb2babcdf4f710a9af8c7fbc4379ef0d4cfaa77f1ca587b66bff564297147e065afeac
data/guard-rspec.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.require_path = 'lib'
19
19
 
20
20
  s.add_dependency 'guard', '>= 2.1.1'
21
- s.add_dependency 'rspec', '~> 2.14'
21
+ s.add_dependency 'rspec', '>= 2.14', '< 4.0'
22
22
  s.add_development_dependency 'bundler', '>= 1.3.5'
23
23
  s.add_development_dependency 'rake'
24
24
  s.add_development_dependency 'rspec'
@@ -29,32 +29,32 @@ module Guard
29
29
 
30
30
  def _version_option
31
31
  return unless options.key?(:version)
32
- _deprectated('The :version option is deprecated. Only RSpec ~> 2.14 is now supported.')
32
+ _deprecated('The :version option is deprecated. Only RSpec ~> 2.14 is now supported.')
33
33
  end
34
34
 
35
35
  def _exclude_option
36
36
  return unless options.key?(:exclude)
37
- _deprectated('The :exclude option is deprecated. Please Guard ignore method instead. https://github.com/guard/guard#ignore')
37
+ _deprecated('The :exclude option is deprecated. Please Guard ignore method instead. https://github.com/guard/guard#ignore')
38
38
  end
39
39
 
40
40
  def _use_cmd_option
41
41
  %w[color drb fail_fast formatter env bundler binstubs rvm cli spring turnip zeus foreman].each do |option|
42
42
  next unless options.key?(option.to_sym)
43
- _deprectated("The :#{option} option is deprecated. Please customize the new :cmd option to fit your need.")
43
+ _deprecated("The :#{option} option is deprecated. Please customize the new :cmd option to fit your need.")
44
44
  end
45
45
  end
46
46
 
47
47
  def _keep_failed_option
48
48
  return unless options.key?(:keep_failed)
49
- _deprectated('The :keep_failed option is deprecated. Please set new :failed_mode option value to :keep instead. https://github.com/guard/guard-rspec#list-of-available-options')
49
+ _deprecated('The :keep_failed option is deprecated. Please set new :failed_mode option value to :keep instead. https://github.com/guard/guard-rspec#list-of-available-options')
50
50
  end
51
51
 
52
52
  def _focus_on_failed_option
53
53
  return unless options.key?(:focus_on_failed)
54
- _deprectated('The :focus_on_failed option is deprecated. Focus mode is the default and can be changed using new :failed_mode option. https://github.com/guard/guard-rspec#list-of-available-options')
54
+ _deprecated('The :focus_on_failed option is deprecated. Focus mode is the default and can be changed using new :failed_mode option. https://github.com/guard/guard-rspec#list-of-available-options')
55
55
  end
56
56
 
57
- def _deprectated(message)
57
+ def _deprecated(message)
58
58
  UI.warning %{Guard::RSpec DEPRECATION WARNING: #{message}}
59
59
  end
60
60
 
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module RSpecVersion
3
- VERSION = '4.1.1'
3
+ VERSION = '4.2.0'
4
4
  end
5
5
  end
@@ -30,7 +30,7 @@ describe Guard::RSpec::Command do
30
30
 
31
31
  context "with RSpec defined formatter" do
32
32
  let(:formatters) { [['doc','output']] }
33
- before { RSpec::Core::ConfigurationOptions.stub(:new) { double(parse_options: { formatters: formatters }) } }
33
+ before { allow(RSpec::Core::ConfigurationOptions).to receive(:new) { double(parse_options: { formatters: formatters }) } }
34
34
 
35
35
  it "uses them" do
36
36
  expect(command).to match %r{-f doc -o output}
@@ -9,13 +9,13 @@ describe Guard::RSpec::Formatter do
9
9
  after { File.delete('./tmp/rspec_guard_result') }
10
10
 
11
11
  context 'with failures' do
12
- let(:example) { double(
12
+ let(:failed_example) { double(
13
13
  execution_result: { status: 'failed' },
14
14
  metadata: { location: 'failed_location' }
15
15
  ) }
16
16
 
17
17
  it 'writes summary line and failed location in tmp dir' do
18
- formatter.stub(:examples) { [example] }
18
+ allow(formatter).to receive(:examples) { [failed_example] }
19
19
  formatter.dump_summary(123, 3, 1, 0)
20
20
  result = File.open('./tmp/rspec_guard_result').read
21
21
  expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\nfailed_location\n$/
@@ -8,13 +8,13 @@ describe Guard::RSpec::Runner do
8
8
  let(:notifier) { double(Guard::RSpec::Notifier) }
9
9
  let(:formatter_tmp_file) { Guard::RSpec::Formatter::TEMPORARY_FILE_PATH }
10
10
  before {
11
- Guard::UI.stub(:info)
12
- Kernel.stub(:system) { true }
13
- Guard::RSpec::Inspectors::Factory.stub(:create) { inspector }
14
- Guard::RSpec::Notifier.stub(:new) { notifier }
15
- Guard::RSpec::Command.stub(:new) { 'rspec' }
16
- notifier.stub(:notify)
17
- notifier.stub(:notify_failure)
11
+ allow(Guard::UI).to receive(:info)
12
+ allow(Kernel).to receive(:system) { true }
13
+ allow(Guard::RSpec::Inspectors::Factory).to receive(:create) { inspector }
14
+ allow(Guard::RSpec::Notifier).to receive(:new) { notifier }
15
+ allow(Guard::RSpec::Command).to receive(:new) { 'rspec' }
16
+ allow(notifier).to receive(:notify)
17
+ allow(notifier).to receive(:notify_failure)
18
18
  }
19
19
 
20
20
  describe '.initialize' do
@@ -71,10 +71,10 @@ describe Guard::RSpec::Runner do
71
71
  describe '#run' do
72
72
  let(:paths) { %w[spec_path1 spec_path2] }
73
73
  before {
74
- File.stub(:readlines).with(formatter_tmp_file) { %W{Summary\n} }
75
- inspector.stub(:paths) { paths }
76
- inspector.stub(:clear_paths) { true }
77
- inspector.stub(:failed)
74
+ allow(File).to receive(:readlines).with(formatter_tmp_file) { %W{Summary\n} }
75
+ allow(inspector).to receive(:paths) { paths }
76
+ allow(inspector).to receive(:clear_paths) { true }
77
+ allow(inspector).to receive(:failed)
78
78
  }
79
79
 
80
80
  it 'prints running message' do
@@ -83,7 +83,7 @@ describe Guard::RSpec::Runner do
83
83
  end
84
84
 
85
85
  it 'returns if no paths are given' do
86
- inspector.stub(:paths) { [] }
86
+ allow(inspector).to receive(:paths) { [] }
87
87
  expect(Guard::UI).to_not receive(:info)
88
88
  runner.run([])
89
89
  end
@@ -106,7 +106,7 @@ describe Guard::RSpec::Runner do
106
106
  let(:options) { { launchy: 'launchy_path' } }
107
107
 
108
108
  before {
109
- Pathname.stub(:new).with('launchy_path') { double(exist?: true) }
109
+ allow(Pathname).to receive(:new).with('launchy_path') { double(exist?: true) }
110
110
  }
111
111
 
112
112
  it 'opens Launchy' do
@@ -122,7 +122,7 @@ describe Guard::RSpec::Runner do
122
122
 
123
123
  context 'with failed paths' do
124
124
  before {
125
- File.stub(:readlines).with(formatter_tmp_file) { %W{Summary\n ./failed_spec.rb:123\n ./other/failed_spec.rb:77\n} }
125
+ allow(File).to receive(:readlines).with(formatter_tmp_file) { %W{Summary\n ./failed_spec.rb:123\n ./other/failed_spec.rb:77\n} }
126
126
  }
127
127
 
128
128
  it 'notifies inspector about failed paths' do
@@ -137,7 +137,7 @@ describe Guard::RSpec::Runner do
137
137
  end
138
138
 
139
139
  it 'notifies failure' do
140
- Kernel.stub(:system) { nil }
140
+ allow(Kernel).to receive(:system) { nil }
141
141
  expect(notifier).to receive(:notify_failure)
142
142
  runner.run(paths)
143
143
  end
@@ -6,9 +6,9 @@ describe Guard::RSpec do
6
6
  let(:plugin) { Guard::RSpec.new(options) }
7
7
  let(:runner) { double(Guard::RSpec::Runner) }
8
8
  before {
9
- Guard::UI.stub(:info)
10
- Guard::RSpec::Deprecator.stub(:warns_about_deprecated_options)
11
- Guard::RSpec::Runner.stub(:new) { runner }
9
+ allow(Guard::UI).to receive(:info)
10
+ allow(Guard::RSpec::Deprecator).to receive(:warns_about_deprecated_options)
11
+ allow(Guard::RSpec::Runner).to receive(:new) { runner }
12
12
  }
13
13
 
14
14
  describe '.initialize' do
@@ -51,7 +51,7 @@ describe Guard::RSpec do
51
51
  end
52
52
 
53
53
  it "throws task_has_failed if runner return false" do
54
- runner.stub(:run_all) { false }
54
+ allow(runner).to receive(:run_all) { false }
55
55
  expect(plugin).to receive(:throw).with(:task_has_failed)
56
56
  plugin.run_all
57
57
  end
@@ -77,7 +77,7 @@ describe Guard::RSpec do
77
77
  end
78
78
 
79
79
  it "throws task_has_failed if runner return false" do
80
- runner.stub(:run) { false }
80
+ allow(runner).to receive(:run) { false }
81
81
  expect(plugin).to receive(:throw).with(:task_has_failed)
82
82
  plugin.run_on_modifications(paths)
83
83
  end
data/spec/spec_helper.rb CHANGED
@@ -10,7 +10,7 @@ RSpec.configure do |config|
10
10
  config.color_enabled = true
11
11
  config.order = :random
12
12
  config.filter_run focus: ENV['CI'] != 'true'
13
- config.treat_symbols_as_metadata_keys_with_true_values = true
13
+ config.treat_symbols_as_metadata_keys_with_true_values = true if RSpec::Version::STRING.to_i < 3
14
14
  config.run_all_when_everything_filtered = true
15
15
  config.expect_with :rspec do |c|
16
16
  c.syntax = :expect
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibaud Guillaume-Gentil
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '2.14'
34
+ - - <
35
+ - !ruby/object:Gem::Version
36
+ version: '4.0'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - ~>
41
+ - - '>='
39
42
  - !ruby/object:Gem::Version
40
43
  version: '2.14'
44
+ - - <
45
+ - !ruby/object:Gem::Version
46
+ version: '4.0'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: bundler
43
49
  requirement: !ruby/object:Gem::Requirement