respec 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/lib/respec/app.rb +5 -0
- data/lib/respec/version.rb +1 -1
- data/spec/respec/app_spec.rb +30 -5
- metadata +4 -4
data/CHANGELOG
CHANGED
data/lib/respec/app.rb
CHANGED
@@ -113,6 +113,11 @@ module Respec
|
|
113
113
|
args << '--example' << arg.gsub(/[$]/, '\\\\\\0')
|
114
114
|
end
|
115
115
|
end
|
116
|
+
|
117
|
+
# Since we append our formatter as a file to run, rspec won't fall back to
|
118
|
+
# using 'spec' by default. Add it explicitly here.
|
119
|
+
files << 'spec' if files.empty?
|
120
|
+
|
116
121
|
# If we selected individual failures to rerun, don't give the files to
|
117
122
|
# rspec, as those files will be run in their entirety.
|
118
123
|
@generated_args = args
|
data/lib/respec/version.rb
CHANGED
data/spec/respec/app_spec.rb
CHANGED
@@ -70,13 +70,15 @@ describe Respec::App do
|
|
70
70
|
end
|
71
71
|
|
72
72
|
describe "#generated_args" do
|
73
|
-
it "should
|
74
|
-
|
75
|
-
app
|
73
|
+
it "should pass all arguments that start with '-' to rspec" do
|
74
|
+
FileUtils.touch "#{tmp}/file"
|
75
|
+
app = Respec::App.new('-a', '-b', '-c', "#{tmp}/file")
|
76
|
+
app.generated_args.should == ['-a', '-b', '-c', "#{tmp}/file"]
|
76
77
|
end
|
77
78
|
|
78
79
|
it "should pass arguments for rspec options that need them" do
|
79
|
-
|
80
|
+
FileUtils.touch "#{tmp}/file"
|
81
|
+
Respec::App.new('-I', 'lib', '-t', 'mytag', "#{tmp}/file").generated_args.should == ['-I', 'lib', '-t', 'mytag', "#{tmp}/file"]
|
80
82
|
end
|
81
83
|
|
82
84
|
it "should run all failures if 'f' is given" do
|
@@ -122,6 +124,29 @@ describe Respec::App do
|
|
122
124
|
app = Respec::App.new("#{tmp}/FILE", 'f')
|
123
125
|
app.generated_args.should == ['a.rb:1']
|
124
126
|
end
|
127
|
+
|
128
|
+
it "should explicitly add the spec directory if no files are given or errors to rerun" do
|
129
|
+
app = Respec::App.new
|
130
|
+
app.generated_args.should == ['spec']
|
131
|
+
end
|
132
|
+
|
133
|
+
it "should not add the spec directory if any files are given" do
|
134
|
+
FileUtils.touch "#{tmp}/FILE"
|
135
|
+
app = Respec::App.new("#{tmp}/FILE")
|
136
|
+
app.generated_args.should == ["#{tmp}/FILE"]
|
137
|
+
end
|
138
|
+
|
139
|
+
it "should not add the spec directory if a numeric argument is given" do
|
140
|
+
make_failures_file 'a.rb:1'
|
141
|
+
app = Respec::App.new('1')
|
142
|
+
app.generated_args.should == ["a.rb:1"]
|
143
|
+
end
|
144
|
+
|
145
|
+
it "should not add the spec directory if an 'f' argument is given" do
|
146
|
+
make_failures_file 'a.rb:1'
|
147
|
+
app = Respec::App.new('f')
|
148
|
+
app.generated_args.should == ["a.rb:1"]
|
149
|
+
end
|
125
150
|
end
|
126
151
|
|
127
152
|
describe "#raw_args" do
|
@@ -136,7 +161,7 @@ describe Respec::App do
|
|
136
161
|
Dir.chdir tmp do
|
137
162
|
FileUtils.touch 'Gemfile'
|
138
163
|
app = Respec::App.new('--', '-t', 'TAG')
|
139
|
-
app.command.should == ['bundle', 'exec', 'rspec', '-t', 'TAG', FORMATTER_PATH]
|
164
|
+
app.command.should == ['bundle', 'exec', 'rspec', 'spec', '-t', 'TAG', FORMATTER_PATH]
|
140
165
|
end
|
141
166
|
end
|
142
167
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: respec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -98,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
segments:
|
100
100
|
- 0
|
101
|
-
hash:
|
101
|
+
hash: -2382265690551011023
|
102
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
103
|
none: false
|
104
104
|
requirements:
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
segments:
|
109
109
|
- 0
|
110
|
-
hash:
|
110
|
+
hash: -2382265690551011023
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
113
|
rubygems_version: 1.8.24
|