respec 0.0.3 → 0.1.0
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.
- data/.travis.yml +9 -0
- data/CHANGELOG +5 -0
- data/README.markdown +3 -1
- data/Rakefile +4 -0
- data/lib/respec/app.rb +4 -9
- data/lib/respec/version.rb +1 -1
- data/respec.gemspec +1 -0
- data/spec/integration_spec.rb +8 -4
- data/spec/respec/app_spec.rb +6 -22
- metadata +11 -3
data/.travis.yml
ADDED
data/CHANGELOG
CHANGED
data/README.markdown
CHANGED
@@ -48,7 +48,9 @@ command line:
|
|
48
48
|
If the argument doesn't name an existing file, it's assumed to be an
|
49
49
|
example name.
|
50
50
|
|
51
|
-
|
51
|
+
It'll even `bundle exec` for you automatically.
|
52
|
+
|
53
|
+
There are a few other shortcuts. `respec --help` to see them all.
|
52
54
|
|
53
55
|
## Contributing
|
54
56
|
|
data/Rakefile
CHANGED
data/lib/respec/app.rb
CHANGED
@@ -56,13 +56,12 @@ module Respec
|
|
56
56
|
|
|
57
57
|
| f Rerun all failed examples
|
58
58
|
| <integer> Rerun only the n-th failure
|
59
|
-
| s Output specdoc format, instead of progress
|
60
|
-
| c Output context diffs
|
61
59
|
| <file name> Run specs in these files
|
62
60
|
| <other> Run only examples matching this pattern
|
63
61
|
| --help This! (Also 'help'.)
|
62
|
+
| -<anything> Passed directly to rspec.
|
64
63
|
|
|
65
|
-
|RSPEC-ARGS may follow a '--' argument, and are passed
|
64
|
+
|RSPEC-ARGS may follow a '--' argument, and are also passed
|
66
65
|
|directly to rspec.
|
67
66
|
|
|
68
67
|
|More info: http://github.com/oggy/respec
|
@@ -79,6 +78,8 @@ module Respec
|
|
79
78
|
files << arg
|
80
79
|
elsif arg =~ /\A(--)?help\z/
|
81
80
|
@help_only = true
|
81
|
+
elsif arg =~ /\A-/
|
82
|
+
args << arg
|
82
83
|
elsif arg == 'f'
|
83
84
|
if File.exist?(failures_path)
|
84
85
|
if failures.empty?
|
@@ -94,12 +95,6 @@ module Respec
|
|
94
95
|
end
|
95
96
|
elsif arg == 's'
|
96
97
|
@formatter = 'specdoc'
|
97
|
-
elsif arg == 'd'
|
98
|
-
args << '--debugger'
|
99
|
-
elsif arg =~ /\A[xX]\z/
|
100
|
-
args << '--drb'
|
101
|
-
elsif arg == 'c'
|
102
|
-
args << '--diff' << 'context'
|
103
98
|
elsif arg =~ /\A\d+\z/
|
104
99
|
i = Integer(arg)
|
105
100
|
if (failure = failures[i - 1])
|
data/lib/respec/version.rb
CHANGED
data/respec.gemspec
CHANGED
@@ -6,6 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.version = Respec::VERSION
|
7
7
|
gem.authors = ['George Ogata']
|
8
8
|
gem.email = ['george.ogata@gmail.com']
|
9
|
+
gem.license = 'MIT'
|
9
10
|
gem.summary = "Rerun failing RSpec examples easily."
|
10
11
|
gem.homepage = 'http://github.com/oggy/respec'
|
11
12
|
|
data/spec/integration_spec.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require File.expand_path('spec_helper', File.dirname(__FILE__))
|
2
2
|
require 'rbconfig'
|
3
3
|
|
4
4
|
describe Respec do
|
@@ -6,6 +6,10 @@ describe Respec do
|
|
6
6
|
|
7
7
|
CONFIG = (Object.const_defined?(:RbConfig) ? RbConfig : Config)::CONFIG
|
8
8
|
def respec(args)
|
9
|
+
# Rubinius can trip here as the simulated edits to the .rb files happen quickly enough that the
|
10
|
+
# .rbc will look current. Blow away the .rbx directory to ensure the source is read each time.
|
11
|
+
FileUtils.rm_rf '.rbx'
|
12
|
+
|
9
13
|
ruby = File.join(CONFIG['bindir'], CONFIG['ruby_install_name'])
|
10
14
|
respec = "#{ROOT}/bin/respec"
|
11
15
|
output = `RESPEC_FAILURES=#{TMP}/failures.txt #{ruby} -I #{ROOT}/lib #{respec} #{args} 2>&1`
|
@@ -34,17 +38,17 @@ describe Respec do
|
|
34
38
|
|
35
39
|
it "should let you rerun failing specs until they all pass" do
|
36
40
|
Dir.chdir tmp do
|
37
|
-
make_spec(num_failures
|
41
|
+
make_spec(:num_failures => 2)
|
38
42
|
status, output = respec(spec_path)
|
39
43
|
status.should_not be_success
|
40
44
|
output.should include('2 examples, 2 failures')
|
41
45
|
|
42
|
-
make_spec(num_failures
|
46
|
+
make_spec(:num_failures => 1)
|
43
47
|
status, output = respec("#{spec_path} f")
|
44
48
|
status.should_not be_success
|
45
49
|
output.should include('2 examples, 1 failure')
|
46
50
|
|
47
|
-
make_spec(num_failures
|
51
|
+
make_spec(:num_failures => 0)
|
48
52
|
status, output = respec("#{spec_path} f")
|
49
53
|
status.should be_success
|
50
54
|
output.should include('1 example, 0 failures')
|
data/spec/respec/app_spec.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require File.expand_path('../spec_helper', File.dirname(__FILE__))
|
3
2
|
require 'fileutils'
|
4
3
|
|
5
4
|
describe Respec::App do
|
@@ -77,9 +76,9 @@ describe Respec::App do
|
|
77
76
|
end
|
78
77
|
|
79
78
|
describe "#generated_args" do
|
80
|
-
it "should
|
81
|
-
app = Respec::App.new('c')
|
82
|
-
app.generated_args.should == ['
|
79
|
+
it "should treat all arguments that start with '-' to rspec" do
|
80
|
+
app = Respec::App.new('-a', '-b', '-c')
|
81
|
+
app.generated_args.should == ['-a', '-b', '-c']
|
83
82
|
end
|
84
83
|
|
85
84
|
it "should run all failures if 'f' is given" do
|
@@ -88,21 +87,6 @@ describe Respec::App do
|
|
88
87
|
app.generated_args.should == ['a.rb:1', 'b.rb:2']
|
89
88
|
end
|
90
89
|
|
91
|
-
it "should run via the debugger if 'd' is given" do
|
92
|
-
app = Respec::App.new('d')
|
93
|
-
app.generated_args.should == ['--debugger']
|
94
|
-
end
|
95
|
-
|
96
|
-
it "should run via DRb if 'X' is given" do
|
97
|
-
app = Respec::App.new('X')
|
98
|
-
app.generated_args.should == ['--drb']
|
99
|
-
end
|
100
|
-
|
101
|
-
it "should run via DRb if 'x' is given" do
|
102
|
-
app = Respec::App.new('x')
|
103
|
-
app.generated_args.should == ['--drb']
|
104
|
-
end
|
105
|
-
|
106
90
|
it "should run the n-th failure if a numeric argument 'n' is given" do
|
107
91
|
make_failures_file 'a.rb:1', 'b.rb:2'
|
108
92
|
app = Respec::App.new('2')
|
@@ -147,8 +131,8 @@ describe Respec::App do
|
|
147
131
|
it "should combine all the args" do
|
148
132
|
Dir.chdir tmp do
|
149
133
|
FileUtils.touch 'Gemfile'
|
150
|
-
app = Respec::App.new('
|
151
|
-
app.command.should == ['bundle', 'exec', 'rspec', '--require', FORMATTER_PATH, '--format', 'Respec::Formatter', '--out', FAIL_PATH, '--format', 'progress', '
|
134
|
+
app = Respec::App.new('--', '-t', 'TAG')
|
135
|
+
app.command.should == ['bundle', 'exec', 'rspec', '--require', FORMATTER_PATH, '--format', 'Respec::Formatter', '--out', FAIL_PATH, '--format', 'progress', '-t', 'TAG']
|
152
136
|
end
|
153
137
|
end
|
154
138
|
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.0
|
4
|
+
version: 0.1.0
|
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-
|
12
|
+
date: 2012-06-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -68,6 +68,7 @@ extensions: []
|
|
68
68
|
extra_rdoc_files: []
|
69
69
|
files:
|
70
70
|
- .gitignore
|
71
|
+
- .travis.yml
|
71
72
|
- CHANGELOG
|
72
73
|
- Gemfile
|
73
74
|
- LICENSE
|
@@ -83,7 +84,8 @@ files:
|
|
83
84
|
- spec/respec/app_spec.rb
|
84
85
|
- spec/spec_helper.rb
|
85
86
|
homepage: http://github.com/oggy/respec
|
86
|
-
licenses:
|
87
|
+
licenses:
|
88
|
+
- MIT
|
87
89
|
post_install_message:
|
88
90
|
rdoc_options: []
|
89
91
|
require_paths:
|
@@ -94,12 +96,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
96
|
- - ! '>='
|
95
97
|
- !ruby/object:Gem::Version
|
96
98
|
version: '0'
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
hash: -4339172724933482558
|
97
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
103
|
none: false
|
99
104
|
requirements:
|
100
105
|
- - ! '>='
|
101
106
|
- !ruby/object:Gem::Version
|
102
107
|
version: '0'
|
108
|
+
segments:
|
109
|
+
- 0
|
110
|
+
hash: -4339172724933482558
|
103
111
|
requirements: []
|
104
112
|
rubyforge_project:
|
105
113
|
rubygems_version: 1.8.24
|