respec 0.8.1 → 0.8.2
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 +4 -4
- data/CHANGELOG +4 -0
- data/lib/respec/app.rb +9 -0
- data/lib/respec/version.rb +1 -1
- data/spec/respec/app_spec.rb +14 -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: 5287ceff6fa9eded7c5f0a8912ca3c8055ed7cba
|
4
|
+
data.tar.gz: 7a9e5aefa1fc9bf66e8abf70fe11974a30169d77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59702ab706685adfb63d56bd7c69a6f84b1c343657f5719b848206652145526c2e6b9b8989ced2f6455e80b406f331049b3f4b6cd04e49db288a0f0afe537244
|
7
|
+
data.tar.gz: c07787371280320de0e648bf1f80ee54f4c27d1992f8b77fd03f269fc51ed7d23f8a6120419cb3ebe41ea40cd92c7e99a6688d1678d8890feef812f5f93888d3
|
data/CHANGELOG
CHANGED
data/lib/respec/app.rb
CHANGED
@@ -78,6 +78,7 @@ module Respec
|
|
78
78
|
args = []
|
79
79
|
files = []
|
80
80
|
pass_next_arg = false
|
81
|
+
using_filters = false
|
81
82
|
@args.each do |arg|
|
82
83
|
if pass_next_arg
|
83
84
|
args << arg
|
@@ -108,11 +109,13 @@ module Respec
|
|
108
109
|
[]
|
109
110
|
end
|
110
111
|
end
|
112
|
+
using_filters = true
|
111
113
|
elsif arg =~ /\A\d+\z/
|
112
114
|
i = Integer(arg)
|
113
115
|
if (failure = failures[i - 1])
|
114
116
|
args << '-e' << failure
|
115
117
|
@update_failures = false
|
118
|
+
using_filters = true
|
116
119
|
else
|
117
120
|
warn "invalid failure: #{i} for (1..#{failures.size})"
|
118
121
|
end
|
@@ -130,6 +133,12 @@ module Respec
|
|
130
133
|
end
|
131
134
|
end
|
132
135
|
|
136
|
+
# If rerunning failures, chop off explicit line numbers, as they are
|
137
|
+
# additive, and filters are subtractive.
|
138
|
+
if using_filters
|
139
|
+
files.map! { |f| f.sub(/:\d+\z/, '') }
|
140
|
+
end
|
141
|
+
|
133
142
|
# Since we append our formatter as a file to run, rspec won't fall back to
|
134
143
|
# using 'spec' by default. Add it explicitly here.
|
135
144
|
files << 'spec' if files.empty?
|
data/lib/respec/version.rb
CHANGED
data/spec/respec/app_spec.rb
CHANGED
@@ -136,6 +136,20 @@ describe Respec::App do
|
|
136
136
|
expect(app.generated_args).to eq ["#{tmp}/existing.rb:123"]
|
137
137
|
end
|
138
138
|
|
139
|
+
it "should truncate line numbers when using numeric arguments" do
|
140
|
+
make_failures_file 'a'
|
141
|
+
FileUtils.touch "#{tmp}/existing.rb"
|
142
|
+
app = Respec::App.new("#{tmp}/existing.rb:123", '1')
|
143
|
+
expect(app.generated_args).to eq ['-e', 'a', "#{tmp}/existing.rb"]
|
144
|
+
end
|
145
|
+
|
146
|
+
it "should truncate line numbers when rerunning all failures" do
|
147
|
+
make_failures_file 'a'
|
148
|
+
FileUtils.touch "#{tmp}/existing.rb"
|
149
|
+
app = Respec::App.new("#{tmp}/existing.rb:123", 'f')
|
150
|
+
expect(app.generated_args).to eq ['-e', 'a', "#{tmp}/existing.rb"]
|
151
|
+
end
|
152
|
+
|
139
153
|
it "should treat other arguments as example names" do
|
140
154
|
app = Respec::App.new('a', 'b')
|
141
155
|
expect(app.generated_args).to eq ['-e', 'a', '-e', 'b', 'spec']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: respec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- George Ogata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|