guard-rspec 4.7.0 → 4.7.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fc28c16ceeddadc68019093ed5e2d48362f5c3c
4
- data.tar.gz: 3b52eda168c7398bca052b5c01497b97dd2d11bd
3
+ metadata.gz: b6163bfd9a274c88eefd7a84f1e1f815d1191b33
4
+ data.tar.gz: 80deab415f449c74ec8b4f50589dae22f80ec021
5
5
  SHA512:
6
- metadata.gz: c2770e272f1965dd1cce1878f5dcb9617dff9519c453f6806fa8c7945603476edfe5cf33289a4d95267f154eb15cee8ba10459263b00ca987436e94c16909736
7
- data.tar.gz: 293ed7b6f57587da0b3b4df12a8b0520b0d33b2fe16b17c8222ceb09c458dae57de5a7b8da95d74d65b69e16fc8be3452adc01055ebc3bcf65bf4acbb3c70aee
6
+ metadata.gz: 1618cbb9b313aff920902dfd34780c12b076b627a6f287cd9b8ab38451a38ba532e1d1d3dd1ca5a34a6d8fee07394a256431806a9a67a7e1b8581ea7899e2daa
7
+ data.tar.gz: dff4b7a5a92c25b42a5beda572ea707958fe2e2d173f2582838d4aa790d5fa8b64f1b330703738f8e7b301b75714655c2a59ec19d6e9dfc94e28107931e1c28d
@@ -0,0 +1,3 @@
1
+ ruby:
2
+ enabled: true
3
+ config_file: .rubocop.yml
@@ -1,2 +1,5 @@
1
1
  inherit_from:
2
2
  .rubocop_todo.yml
3
+
4
+ Style/StringLiterals:
5
+ Enabled: false
@@ -1,14 +1,14 @@
1
1
  language: ruby
2
- bundler_args: --without tool
2
+ bundler_args: --without=tool development
3
3
  rvm:
4
4
  - 2.2.5
5
5
  - 2.3.1
6
- - jruby-9.0.5.0
6
+ - jruby-9.1.1.0
7
7
  gemfile:
8
8
  - gemfiles/Gemfile.rspec-2.99
9
9
  - gemfiles/Gemfile.rspec-3.4
10
10
  matrix:
11
11
  allow_failures:
12
- - rvm: jruby-9.0.50
12
+ - rvm: jruby-9.1.1.0
13
13
  sudo: false
14
14
  cache: bundler
data/Gemfile CHANGED
@@ -1,18 +1,27 @@
1
- source "https://rubygems.org"
1
+ # Note: on Travis, this Gemfile is only for installing
2
+ # dependencies. The actual builds use the Gemfiles in
3
+ # the gemspecs/* directory.
4
+
5
+ filename = "gemfiles/common"
6
+ instance_eval(IO.read(filename), filename, 1)
7
+
8
+ group :test do
9
+ gem "rspec", "~> 3.4"
10
+ end
2
11
 
3
12
  if ENV["USE_INSTALLED_GUARD_RSPEC"] == "1"
4
13
  gem "guard-rspec"
5
- gem "launchy"
6
14
  else
7
- gemspec
15
+ gemspec development_group: :gem_build_tools
8
16
  end
9
17
 
10
- group :test do
11
- gem "coveralls", require: false
18
+ # bundler + rake - always included
19
+ group :gem_build_tools do
20
+ gem "bundler", "~> 1.12", "< 2.0"
21
+ gem "rake", "~> 11.1"
12
22
  end
13
23
 
14
24
  group :development do
15
- gem "rspec", "~> 3.4"
16
25
  gem "rubocop", require: false
17
26
  gem "guard-rubocop", require: false
18
27
  gem "guard-compat", ">= 0.0.2", require: false
data/README.md CHANGED
@@ -21,6 +21,28 @@ Add guard definition to your Guardfile by running this command:
21
21
  $ guard init rspec
22
22
  ```
23
23
 
24
+ ## Installing with beta versions of RSpec
25
+
26
+ To install beta versions of RSpec, you need to set versions of all the dependencies, e.g:
27
+
28
+ ```ruby
29
+ gem 'rspec', '= 3.5.0.beta3'
30
+ gem 'rspec-core', '= 3.5.0.beta3'
31
+ gem 'rspec-expectations', '= 3.5.0.beta3'
32
+ gem 'rspec-mocks', '= 3.5.0.beta3'
33
+ gem 'rspec-support', '= 3.5.0.beta3'
34
+
35
+ gem 'guard-rspec, '~> 4.7`
36
+ ```
37
+
38
+ and for Rails projects this also means adding:
39
+
40
+ ```ruby
41
+ gem 'rspec-rails', '= 3.5.0.beta3'
42
+ ```
43
+
44
+ and then running `bundle update rspec rspec-core rspec-expectations rspec-mocks rspec-support rspec-rails` or just `bundle update` to update all the gems in your project.
45
+
24
46
  ## Usage
25
47
 
26
48
  Please read [Guard usage doc](https://github.com/guard/guard#readme).
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ namespace :test do
21
21
  task :all_versions do
22
22
  system(*%w(bundle install --quiet)) || abort
23
23
  system(*%w(bundle update --quiet)) || abort
24
- system(*%w(bundle exec rubocop -c .hound.yml)) || abort
24
+ system(*%w(bundle exec rubocop -c .rubocop.yml)) || abort
25
25
 
26
26
  travis = YAML.load(IO.read(".travis.yml"))
27
27
  travis["gemfile"].each do |gemfile|
@@ -1,14 +1,6 @@
1
- source "https://rubygems.org"
2
-
3
1
  gemspec path: '../'
4
2
 
5
- gem 'rspec', '~> 2.99'
6
-
7
- group :test do
8
- gem 'coveralls', require: false
9
- gem "guard-compat", ">= 0.0.2", require: false
10
- end
3
+ filename = "gemfiles/common"
4
+ instance_eval(IO.read(filename), filename, 1)
11
5
 
12
- group :tool do
13
- gem 'ruby_gntp', require: false
14
- end
6
+ gem 'rspec', '~> 2.99'
@@ -1,14 +1,6 @@
1
- source "https://rubygems.org"
2
-
3
1
  gemspec path: '../'
4
2
 
5
- gem 'rspec', '~> 3.4.0'
6
-
7
- group :test do
8
- gem 'coveralls', require: false
9
- gem "guard-compat", ">= 0.0.2", require: false
10
- end
3
+ filename = "gemfiles/common"
4
+ instance_eval(IO.read(filename), filename, 1)
11
5
 
12
- group :tool do
13
- gem 'ruby_gntp', require: false
14
- end
6
+ gem 'rspec', '~> 3.4.0'
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ group :test do
4
+ gem "bundler", "~> 1.12", "< 2.0"
5
+ gem "rake", "~> 11.1"
6
+ gem 'coveralls', require: false
7
+ gem "launchy", "~> 2.4"
8
+ gem "gem_isolator", '~> 0.2', '>= 0.2.1'
9
+ end
@@ -22,8 +22,4 @@ Gem::Specification.new do |s|
22
22
  s.add_dependency "guard", "~> 2.1"
23
23
  s.add_dependency "guard-compat", "~> 1.1"
24
24
  s.add_dependency "rspec", ">= 2.99.0", "< 4.0"
25
-
26
- s.add_development_dependency "bundler", ">= 1.3.5", "< 2.0"
27
- s.add_development_dependency "rake", "~> 10.1"
28
- s.add_development_dependency "launchy", "~> 2.4"
29
25
  end
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module RSpecVersion
3
- VERSION = "4.7.0".freeze
3
+ VERSION = "4.7.1".freeze
4
4
  end
5
5
  end
@@ -9,8 +9,6 @@ require "rspec/core/formatters/base_formatter"
9
9
 
10
10
  require_relative "rspec_formatter_results_path"
11
11
 
12
- require "guard/ui"
13
-
14
12
  module Guard
15
13
  class RSpecFormatter < ::RSpec::Core::Formatters::BaseFormatter
16
14
  UNSUPPORTED_PATTERN =
@@ -117,9 +115,9 @@ module Guard
117
115
 
118
116
  def _write(&block)
119
117
  file = RSpecFormatterResultsPath.new.path
120
- if Guard.const_defined?(:Compat)
118
+ if ENV['GUARD_RSPEC_DEBUGGING'] == '1'
121
119
  msg = "Guard::RSpec: using results file: #{file.inspect}"
122
- Guard::Compat::UI.debug(format(msg, file))
120
+ STDERR.puts format(msg, file)
123
121
  end
124
122
  FileUtils.mkdir_p(File.dirname(file))
125
123
  File.open(file, "w", &block)
@@ -0,0 +1,4 @@
1
+ RSpec.describe "succeeding spec" do
2
+ it "works" do
3
+ end
4
+ end
@@ -0,0 +1,46 @@
1
+ require 'pathname'
2
+ require 'tempfile'
3
+
4
+ require 'gem_isolator'
5
+
6
+ RSpec.describe "Formatter test", type: :acceptance do
7
+ context "when isolated" do
8
+ before { allow(Kernel).to receive(:system).and_call_original }
9
+
10
+ let!(:formatter) { File.expand_path('lib/guard/rspec_formatter.rb') }
11
+
12
+ context "when a valid results file path is given" do
13
+ around do |example|
14
+ Tempfile.open('results') do |tempfile|
15
+ @results_file = tempfile.path
16
+ example.run
17
+ end
18
+ end
19
+
20
+ context "when a succeeding command is given" do
21
+ let!(:spec) do
22
+ File.expand_path('spec/acceptance/fixtures/succeeding_spec.rb')
23
+ end
24
+
25
+ let(:rspec_args) do
26
+ ['-r', formatter, '-f', 'Guard::RSpecFormatter', spec]
27
+ end
28
+
29
+ context "when guard is not in Gemfile" do
30
+ let(:gems) { [%w(rspec ~>3.4)] }
31
+
32
+ it "works" do
33
+ GemIsolator.isolate(gems: gems) do |env, isolation|
34
+ env = env.merge('GUARD_RSPEC_RESULTS_FILE' => @results_file)
35
+
36
+ # TODO: I don't know why Travis needs a full path for binaries
37
+ # for system() to work.
38
+ rspec = env['PATH'].sub(/:.*/, '/rspec')
39
+ expect(isolation.system(env, rspec, *rspec_args)).to eq(true)
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -3,12 +3,6 @@ require "guard/compat/test/helper"
3
3
  require "guard/rspec/rspec_process"
4
4
 
5
5
  RSpec.describe Guard::RSpec::RSpecProcess do
6
- before do
7
- allow(Kernel).to receive(:spawn) do |*args|
8
- raise "Not stubbed: Kernel.spawn(#{args.map(&:inspect) * ','})"
9
- end
10
- end
11
-
12
6
  let(:results) { instance_double(Guard::RSpec::Results) }
13
7
 
14
8
  let(:cmd) { "foo" }
@@ -29,6 +29,13 @@ end
29
29
 
30
30
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
31
31
  RSpec.configure do |config|
32
+ config.register_ordering :global do |examples|
33
+ examples.partition { |ex| ex.metadata[:type] != :acceptance }.flatten(1)
34
+ end
35
+
36
+ # Use global for running acceptance tests last
37
+ config.order = :global
38
+
32
39
  config.expect_with :rspec do |expectations|
33
40
  # This option will default to `true` in RSpec 4. It makes the `description`
34
41
  # and `failure_message` of custom matchers include text for helper methods
@@ -89,12 +96,6 @@ RSpec.configure do |config|
89
96
  # particularly slow.
90
97
  # config.profile_examples = 10
91
98
 
92
- # Run specs in random order to surface order dependencies. If you find an
93
- # order dependency and want to debug it, you can fix the order by providing
94
- # the seed, which is printed after each run.
95
- # --seed 1234
96
- config.order = :random
97
-
98
99
  # Seed global randomization in this process using the `--seed` CLI option.
99
100
  # Setting this allows you to use `--seed` to deterministically reproduce
100
101
  # test failures related to randomization by passing the same `--seed` value
@@ -136,7 +137,7 @@ RSpec.configure do |config|
136
137
  end
137
138
 
138
139
  %w(spawn system).each do |meth|
139
- allow(File).to receive(meth.to_sym) do |*args|
140
+ allow(Kernel).to receive(meth.to_sym) do |*args|
140
141
  abort "stub me: Kernel.#{meth}(#{args.map(&:inspect) * ','})!"
141
142
  end
142
143
  end
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.7.0
4
+ version: 4.7.1
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: 2016-05-22 00:00:00.000000000 Z
11
+ date: 2016-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -58,54 +58,6 @@ dependencies:
58
58
  - - "<"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '4.0'
61
- - !ruby/object:Gem::Dependency
62
- name: bundler
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: 1.3.5
68
- - - "<"
69
- - !ruby/object:Gem::Version
70
- version: '2.0'
71
- type: :development
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: 1.3.5
78
- - - "<"
79
- - !ruby/object:Gem::Version
80
- version: '2.0'
81
- - !ruby/object:Gem::Dependency
82
- name: rake
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - "~>"
86
- - !ruby/object:Gem::Version
87
- version: '10.1'
88
- type: :development
89
- prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - "~>"
93
- - !ruby/object:Gem::Version
94
- version: '10.1'
95
- - !ruby/object:Gem::Dependency
96
- name: launchy
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: '2.4'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: '2.4'
109
61
  description: Guard::RSpec automatically run your specs (much like autotest).
110
62
  email: thibaud@thibaud.gg
111
63
  executables: []
@@ -113,6 +65,7 @@ extensions: []
113
65
  extra_rdoc_files: []
114
66
  files:
115
67
  - ".gitignore"
68
+ - ".hound.yml"
116
69
  - ".rspec"
117
70
  - ".rubocop.yml"
118
71
  - ".rubocop_todo.yml"
@@ -125,6 +78,7 @@ files:
125
78
  - Rakefile
126
79
  - gemfiles/Gemfile.rspec-2.99
127
80
  - gemfiles/Gemfile.rspec-3.4
81
+ - gemfiles/common
128
82
  - guard-rspec.gemspec
129
83
  - lib/guard/rspec.rb
130
84
  - lib/guard/rspec/command.rb
@@ -145,6 +99,8 @@ files:
145
99
  - lib/guard/rspec_defaults.rb
146
100
  - lib/guard/rspec_formatter.rb
147
101
  - lib/guard/rspec_formatter_results_path.rb
102
+ - spec/acceptance/fixtures/succeeding_spec.rb
103
+ - spec/acceptance/formatter_spec.rb
148
104
  - spec/lib/guard/rspec/command_spec.rb
149
105
  - spec/lib/guard/rspec/deprecator_spec.rb
150
106
  - spec/lib/guard/rspec/inspectors/base_inspector_spec.rb
@@ -186,6 +142,8 @@ signing_key:
186
142
  specification_version: 4
187
143
  summary: Guard gem for RSpec
188
144
  test_files:
145
+ - spec/acceptance/fixtures/succeeding_spec.rb
146
+ - spec/acceptance/formatter_spec.rb
189
147
  - spec/lib/guard/rspec/command_spec.rb
190
148
  - spec/lib/guard/rspec/deprecator_spec.rb
191
149
  - spec/lib/guard/rspec/inspectors/base_inspector_spec.rb