guard-rspec 4.0.3 → 4.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/guard/rspec/inspector.rb +11 -3
- data/lib/guard/rspec/version.rb +1 -1
- data/spec/lib/guard/rspec/inspector_spec.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5d1eeb4a0d8baf1b0f82b447f0bc4e08fe30d86
|
4
|
+
data.tar.gz: af29a93959847c6076ac203a22570cef35cf5f61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca4ff200acd14bf0e93f38f4a13aa55ccb50bb55ddda39535f84f8b449b5c2b907fc08f0c101a17abdc117c41a28d6588759aa106eda15b837eb86a9951dbc4a
|
7
|
+
data.tar.gz: e9300fb45717bb537fd2874e93e5f25d72bef1e5d14db0a53346fa3c8b0258468c448bb7e1518b23451840d370db803b6d5d47720926ce36a8de9ca351564e63
|
@@ -44,7 +44,7 @@ module Guard
|
|
44
44
|
|
45
45
|
def _focused_paths
|
46
46
|
return nil unless options[:focus_on_failed]
|
47
|
-
File.open(FOCUSED_FILE_PATH).read.split("\n")[0..10]
|
47
|
+
File.open(FOCUSED_FILE_PATH) { |f| f.read.split("\n")[0..10] }
|
48
48
|
rescue
|
49
49
|
nil
|
50
50
|
ensure
|
@@ -54,15 +54,23 @@ module Guard
|
|
54
54
|
def _clean(paths)
|
55
55
|
paths.uniq!
|
56
56
|
paths.compact!
|
57
|
-
|
57
|
+
|
58
|
+
spec_dirs = _select_only_spec_dirs(paths)
|
59
|
+
spec_files = _select_only_spec_files(paths)
|
60
|
+
paths = spec_dirs + spec_files
|
61
|
+
|
58
62
|
paths
|
59
63
|
end
|
60
64
|
|
65
|
+
def _select_only_spec_dirs(paths)
|
66
|
+
paths.select { |p| File.directory?(p) || spec_paths.include?(p) }
|
67
|
+
end
|
68
|
+
|
61
69
|
def _select_only_spec_files(paths)
|
62
70
|
spec_files = spec_paths.collect { |path| Dir[File.join(path, "**{,/*/**}", "*[_.]spec.rb")] }
|
63
71
|
feature_files = spec_paths.collect { |path| Dir[File.join(path, "**{,/*/**}", "*.feature")] }
|
64
72
|
files = (spec_files + feature_files).flatten
|
65
|
-
paths.select { |p| files.include?(p)
|
73
|
+
paths.select { |p| files.include?(p) }
|
66
74
|
end
|
67
75
|
|
68
76
|
end
|
data/lib/guard/rspec/version.rb
CHANGED
@@ -46,6 +46,11 @@ describe Guard::RSpec::Inspector do
|
|
46
46
|
expect(inspector.paths(paths + %w[foo])).to eq paths
|
47
47
|
end
|
48
48
|
|
49
|
+
it "returns only rspec directory" do
|
50
|
+
File.stub(:directory?) { true }
|
51
|
+
expect(inspector.paths(%w[spec/foo])).to eq %w[spec/foo]
|
52
|
+
end
|
53
|
+
|
49
54
|
it "returns spec path if given as argument" do
|
50
55
|
expect(inspector.paths(%w[spec])).to eq %w[spec]
|
51
56
|
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.0.
|
4
|
+
version: 4.0.4
|
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: 2013-
|
11
|
+
date: 2013-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
149
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.1.
|
150
|
+
rubygems_version: 2.1.10
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: Guard gem for RSpec
|