guard-rspec 4.2.8 → 4.2.9

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YWMzMjU3M2I0YjA0Zjk3YWE2ZjVkYTRjODY3ODE0NzYyZGM2NmY1ZQ==
4
+ NTRhM2FmMGVmNTRlOGVmMGExZDg2OGRiMGQwMDI0Y2I5OGNjNDBmZA==
5
5
  data.tar.gz: !binary |-
6
- MGVlZjE4MGQ3ZjA5MmQyM2M1NDU4YWYwYTc4OTc3NWMyODQzYmExMA==
6
+ ZjI0OTI0ODkwNjUxNjhhYTJjZmZhMmMxZGZlNzU5ODU3YmRmZWNkMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MGYyMDI5NTY4ZjA2MjIzMWFkZGJhNzRjM2MxMWEwNGI0MzA4N2Y0Zjk2NGM0
10
- YTJlNWM4NDk4Mjg0NTI4MjBlYWJmYWJlMGJmNGI1MGJiZDgxOWNlNzIwYjlj
11
- ZGFhNmM2ZDQ0NmY1NzAwMTMyZmU4Mjc5OGQ2ZmE5NTMyYTc0ZWU=
9
+ OGQxMmRkM2I5NzViMjMwYTgwYTlhYjE5Y2M0NTgwMDZlZDUyOTAyODBkNzcw
10
+ N2JlNmE5YjM1ODgxOWQxYWIyOWI0ZTgyMzE4MWU3YmNlMTViYWUyYTU3ZDcw
11
+ YzY2ZWJhNzIyZGI2Nzg1ODFlMTNmNGNmYWI5MjRmODY3YzA5YTE=
12
12
  data.tar.gz: !binary |-
13
- NjcyNGE3M2FlZGFkYmMyYmZhY2I5MjE3YTZhZTE1NWU4ZWIzYjNkYmQxZDY0
14
- ZmJlOTUyZDYwOWMxMTZjZjY1YWM5MzUxYTExY2Y0MjliMDBkMzRhZjA1MmMy
15
- OWU0MjM3Y2Q5MDA2OWFlZmU2ODc0NThlZTk2YzE3M2JiMDMxMmI=
13
+ NjRmOGZjOTc4MWQwNmFlNjRiNzNiNTdmNTFlOTUzMWM2NTBhYWQ2YjUwYjhl
14
+ Yjc5OGIxNDcyNjZjYjNmZDU1MzlmNmMxMjgxMzY5NDJhODg3OWU2MjlhMzdl
15
+ MTg0N2JjNjc5NTNmM2Y1MWFiNWEwNjEyNDc2NzMwOGZiNjA4OWI=
data/.gitignore CHANGED
@@ -4,7 +4,7 @@ pkg/*
4
4
  .DS_Store
5
5
  .rvmrc
6
6
  .rbx/*
7
- Gemfile.lock
7
+ Gemfile*.lock
8
8
  coverage/
9
9
  .ruby-version
10
10
  .ruby-gemset
data/.travis.yml CHANGED
@@ -6,10 +6,13 @@ rvm:
6
6
  - 2.1.0
7
7
  - jruby-19mode
8
8
  - rbx
9
+ gemfile:
10
+ - gemfiles/Gemfile.rspec-2.14
11
+ - gemfiles/Gemfile.rspec-3.0
9
12
  matrix:
10
13
  allow_failures:
11
14
  - rvm: jruby-19mode
12
15
  - rvm: rbx
13
16
  notifications:
14
17
  recipients:
15
- - thibaud@thibaud.me
18
+ - thibaud@thibaud.gg
@@ -0,0 +1,13 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: '../'
4
+
5
+ gem 'rspec', '~> 2.14'
6
+
7
+ group :test do
8
+ gem 'coveralls', require: false
9
+ end
10
+
11
+ group :tool do
12
+ gem 'ruby_gntp', require: false
13
+ end
@@ -0,0 +1,13 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec path: '../'
4
+
5
+ gem 'rspec', '~> 3.0.0.beta'
6
+
7
+ group :test do
8
+ gem 'coveralls', require: false
9
+ end
10
+
11
+ group :tool do
12
+ gem 'ruby_gntp', require: false
13
+ end
@@ -4,7 +4,7 @@ require 'rspec/core/formatters/base_formatter'
4
4
  module Guard
5
5
  class RSpec
6
6
  class Formatter < ::RSpec::Core::Formatters::BaseFormatter
7
- TEMPORARY_FILE_PATH = File.expand_path('./tmp/rspec_guard_result')
7
+ TEMPORARY_FILE_PATH ||= File.expand_path('./tmp/rspec_guard_result')
8
8
 
9
9
  def self.rspec_3?
10
10
  ::RSpec::Core::Version::STRING.split('.').first == "3"
@@ -42,29 +42,33 @@ module Guard
42
42
  File.fnmatch(::RSpec.configuration.pattern, path.sub(/:\d+\z/, ''), flags)
43
43
  end
44
44
 
45
- # Write summary to temporary file for runner
46
45
  def dump_summary(*args)
47
46
  if self.class.rspec_3?
48
47
  notification = args[0]
49
- duration = notification.duration
50
- total = notification.example_count
51
- failures = notification.failure_count
52
- pending = notification.pending_count
48
+ write_summary(
49
+ notification.duration,
50
+ notification.example_count,
51
+ notification.failure_count,
52
+ notification.pending_count
53
+ )
53
54
  else
54
- duration, total, failures, pending = args
55
+ write_summary(*args)
55
56
  end
57
+ rescue
58
+ # nothing really we can do, at least don't kill the test runner
59
+ end
56
60
 
57
- write do |f|
61
+ # Write summary to temporary file for runner
62
+ def write_summary(duration, total, failures, pending)
63
+ _write do |f|
58
64
  f.puts _message(total, failures, pending, duration)
59
65
  f.puts _failed_paths.join("\n") if failures > 0
60
66
  end
61
- rescue
62
- # nothing really we can do, at least don't kill the test runner
63
67
  end
64
68
 
65
69
  private
66
70
 
67
- def write(&block)
71
+ def _write(&block)
68
72
  FileUtils.mkdir_p(File.dirname(TEMPORARY_FILE_PATH))
69
73
  File.open(TEMPORARY_FILE_PATH, 'w', &block)
70
74
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module RSpecVersion
3
- VERSION = '4.2.8'
3
+ VERSION = '4.2.9'
4
4
  end
5
5
  end
@@ -6,17 +6,17 @@ describe Guard::RSpec::Formatter do
6
6
  it 'is absolute path' do
7
7
  require 'pathname'
8
8
  temporary_file_path = described_class.const_get(:TEMPORARY_FILE_PATH)
9
- expect(Pathname.new(temporary_file_path).absolute?).to be_true
9
+ expect(Pathname.new(temporary_file_path).absolute?).to eq(true)
10
10
  end
11
11
  end
12
12
 
13
- describe '#dump_summary' do
13
+ describe '#write_summary' do
14
14
  let(:writer) {
15
15
  StringIO.new
16
16
  }
17
17
  let(:formatter) {
18
18
  Guard::RSpec::Formatter.new(StringIO.new).tap do |formatter|
19
- formatter.stub(:write) do |&block|
19
+ formatter.stub(:_write) do |&block|
20
20
  block.call writer
21
21
  end
22
22
  end
@@ -35,7 +35,7 @@ describe Guard::RSpec::Formatter do
35
35
  temporary_file_path = described_class.const_get(:TEMPORARY_FILE_PATH)
36
36
  expect(FileUtils).to receive(:mkdir_p).with(File.dirname(temporary_file_path)) {}
37
37
  expect(File).to receive(:open).with(temporary_file_path, 'w') { |filename, mode, &block| block.call writer }
38
- formatter.dump_summary(123, 1, 2, 3)
38
+ formatter.write_summary(123, 1, 2, 3)
39
39
  end
40
40
  end
41
41
 
@@ -50,13 +50,13 @@ describe Guard::RSpec::Formatter do
50
50
 
51
51
  it 'writes summary line and failed location in tmp dir' do
52
52
  allow(formatter).to receive(:examples) { [failed_example] }
53
- formatter.dump_summary(123, 3, 1, 0)
53
+ formatter.write_summary(123, 3, 1, 0)
54
54
  expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\n#{spec_filename}\n$/
55
55
  end
56
56
 
57
57
  it 'writes only uniq filenames out' do
58
58
  allow(formatter).to receive(:examples) { [failed_example, failed_example] }
59
- formatter.dump_summary(123, 3, 1, 0)
59
+ formatter.write_summary(123, 3, 1, 0)
60
60
  expect(result).to match /^3 examples, 1 failures in 123\.0 seconds\n#{spec_filename}\n$/
61
61
  end
62
62
 
@@ -107,14 +107,14 @@ describe Guard::RSpec::Formatter do
107
107
 
108
108
  context 'with only success' do
109
109
  it 'notifies success' do
110
- formatter.dump_summary(123, 3, 0, 0)
110
+ formatter.write_summary(123, 3, 0, 0)
111
111
  expect(result).to match /^3 examples, 0 failures in 123\.0 seconds\n$/
112
112
  end
113
113
  end
114
114
 
115
115
  context 'with pending' do
116
116
  it "notifies pending too" do
117
- formatter.dump_summary(123, 3, 0, 1)
117
+ formatter.write_summary(123, 3, 0, 1)
118
118
  expect(result).to match /^3 examples, 0 failures \(1 pending\) in 123\.0 seconds\n$/
119
119
  end
120
120
  end
@@ -56,6 +56,7 @@ describe Guard::RSpec::Runner do
56
56
  spec_paths: %w[spec1 spec2],
57
57
  run_all: { message: 'Custom message' }
58
58
  } }
59
+ before { allow(inspector).to receive(:failed) }
59
60
 
60
61
  it 'builds commands with spec paths' do
61
62
  expect(Guard::RSpec::Command).to receive(:new).with(%w[spec1 spec2], kind_of(Hash))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.8
4
+ version: 4.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thibaud Guillaume-Gentil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-05 00:00:00.000000000 Z
11
+ date: 2014-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -106,6 +106,8 @@ files:
106
106
  - LICENSE.txt
107
107
  - README.md
108
108
  - Rakefile
109
+ - gemfiles/Gemfile.rspec-2.14
110
+ - gemfiles/Gemfile.rspec-3.0
109
111
  - guard-rspec.gemspec
110
112
  - lib/guard/rspec.rb
111
113
  - lib/guard/rspec/command.rb