guard-rspec 4.6.2 → 4.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +3 -5
- data/lib/guard/rspec/version.rb +1 -1
- data/lib/guard/rspec_formatter.rb +17 -2
- data/spec/lib/guard/rspec_formatter_spec.rb +26 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ad38162aeb4750f21777f6fee50ef832dfc56fd
|
4
|
+
data.tar.gz: 2e740496fd3482134186eb69d27bc5390adc0279
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f84376d5dde753e42ad86dc4b67c71052dc4c72939ba0fb378e709e7a104236c4cf597b0bcfa20f8a61dd942e8a23e8b0ba0c4a802f0d061d5d6dd51273000f
|
7
|
+
data.tar.gz: a878298ab056da49f5f44696b31757253050834f61f65b2b847696fb4e351683bc468862a8e16226e94a15072ed6a427c21917b4a82110883b88727b33683821
|
data/.travis.yml
CHANGED
@@ -2,14 +2,12 @@ language: ruby
|
|
2
2
|
bundler_args: --without tool
|
3
3
|
rvm:
|
4
4
|
- 2.2.2
|
5
|
-
- jruby-
|
6
|
-
- rbx
|
5
|
+
- jruby-head
|
7
6
|
gemfile:
|
8
7
|
- gemfiles/Gemfile.rspec-2.14
|
9
8
|
- gemfiles/Gemfile.rspec-2.99
|
10
9
|
- gemfiles/Gemfile.rspec-3.3
|
11
10
|
matrix:
|
12
11
|
allow_failures:
|
13
|
-
- rvm: jruby-
|
14
|
-
|
15
|
-
- rvm: 1.9.3
|
12
|
+
- rvm: jruby-head
|
13
|
+
sudo: false
|
data/lib/guard/rspec/version.rb
CHANGED
@@ -17,6 +17,17 @@ module Guard
|
|
17
17
|
NO_ENV_WARNING_MSG = "no environment passed - see #{WIKI_ENV_WARN_URL}"
|
18
18
|
NO_RESULTS_VALUE_MSG = ":results_file value unknown (using defaults)"
|
19
19
|
|
20
|
+
UNSUPPORTED_PATTERN = "Your RSpec.configuration.pattern uses characters "\
|
21
|
+
"unsupported by your Ruby version (File::FNM_EXTGLOB is undefined)"
|
22
|
+
|
23
|
+
class Error < RuntimeError
|
24
|
+
class UnsupportedPattern < Error
|
25
|
+
def initialize(msg = UNSUPPORTED_PATTERN)
|
26
|
+
super
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
20
31
|
def self.rspec_3?
|
21
32
|
::RSpec::Core::Version::STRING.split(".").first == "3"
|
22
33
|
end
|
@@ -54,12 +65,16 @@ module Guard
|
|
54
65
|
end
|
55
66
|
|
56
67
|
def self.spec_path?(path)
|
57
|
-
|
68
|
+
pattern = ::RSpec.configuration.pattern
|
69
|
+
|
58
70
|
flags = File::FNM_PATHNAME | File::FNM_DOTMATCH
|
59
71
|
if File.const_defined?(:FNM_EXTGLOB) # ruby >= 2
|
60
72
|
flags |= File::FNM_EXTGLOB
|
73
|
+
elsif pattern =~ /[{}]/
|
74
|
+
fail Error::UnsupportedPattern
|
61
75
|
end
|
62
|
-
|
76
|
+
|
77
|
+
path ||= ""
|
63
78
|
path = path.sub(/:\d+\z/, "")
|
64
79
|
path = Pathname.new(path).cleanpath.to_s
|
65
80
|
File.fnmatch(pattern, path, flags)
|
@@ -100,6 +100,8 @@ RSpec.describe Guard::RSpecFormatter do
|
|
100
100
|
with(file, "w") do |_, _, &block|
|
101
101
|
block.call writer
|
102
102
|
end
|
103
|
+
|
104
|
+
allow(STDERR).to receive(:puts).with(/no environment/)
|
103
105
|
end
|
104
106
|
|
105
107
|
it "warns" do
|
@@ -228,5 +230,29 @@ RSpec.describe Guard::RSpecFormatter do
|
|
228
230
|
)
|
229
231
|
end
|
230
232
|
end
|
233
|
+
|
234
|
+
context "when RSpec 3.0 uses ext globs" do
|
235
|
+
before do
|
236
|
+
allow(::RSpec.configuration).to receive(:pattern).
|
237
|
+
and_return("**{,/*/**}/*_spec.rb")
|
238
|
+
end
|
239
|
+
|
240
|
+
context "when Ruby does not support ext glob matcher" do
|
241
|
+
before do
|
242
|
+
allow(File).to receive(:const_defined?).with(:FNM_EXTGLOB) { false }
|
243
|
+
end
|
244
|
+
|
245
|
+
let(:metadata) { { location: "./spec/foo_spec.rb:75" } }
|
246
|
+
|
247
|
+
it "fails" do
|
248
|
+
expect do
|
249
|
+
described_class.extract_spec_location(metadata)
|
250
|
+
end.to raise_error(
|
251
|
+
described_class::Error::UnsupportedPattern,
|
252
|
+
"Your RSpec.configuration.pattern uses characters unsupported "\
|
253
|
+
"by your Ruby version (File::FNM_EXTGLOB is undefined)")
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
231
257
|
end
|
232
258
|
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.6.
|
4
|
+
version: 4.6.3
|
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: 2015-07-
|
11
|
+
date: 2015-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|