autospec.watchr 0.0.2 → 0.0.5
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/README.rdoc +23 -0
- data/VERSION +1 -1
- data/lib/autospec.watchr.rb +4 -3
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
This is basically a watchr script to autorun Rspec specs.
|
2
|
+
|
3
|
+
What's different to RSpec's autospec
|
4
|
+
|
5
|
+
* The entire suite is not run on start.
|
6
|
+
* Only the current file spec is run on file save.
|
7
|
+
* If an error is found during a run, when that file is saved, only that test is rerun
|
8
|
+
** If that test is fixed, then only that spec file is rerun
|
9
|
+
* It tracks multiple failures and helps you to work through fixing them without continually re-running all your specs.
|
10
|
+
|
11
|
+
==Usage
|
12
|
+
In your project root, run
|
13
|
+
autospec.watchr
|
14
|
+
|
15
|
+
You can run the next saved failure (or if there are no saved failures, all specs) by pressing Ctrl+\
|
16
|
+
You can quit with Ctrl+C
|
17
|
+
|
18
|
+
Enjoy!
|
19
|
+
|
20
|
+
|
21
|
+
I'd love some feedback if you get a chance to play with this.
|
22
|
+
|
23
|
+
Andrew
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/autospec.watchr.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'set'
|
2
|
-
puts "Waiting... (Save a source or spec file and watch the magic happen)
|
2
|
+
puts "Waiting... (Save a source or spec file and watch the magic happen)"
|
3
3
|
|
4
4
|
watch(/spec\/factories.rb$/) { |file| spec(Dir["spec/**/*_spec.rb"]) }
|
5
5
|
watch(/config\/environment.*$/) { |file| spec(Dir["spec/**/*_spec.rb"]) }
|
@@ -41,10 +41,11 @@ def spec(*paths)
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def spec_command(*paths)
|
44
|
+
bundler = File.exist?('Gemfile') ? 'bundle exec ' : ''
|
44
45
|
if File.exist?('.rspec')
|
45
|
-
"rspec #{paths.join(' ')}"
|
46
|
+
"#{bundler}rspec #{paths.join(' ')}"
|
46
47
|
else
|
47
|
-
"spec -O spec/spec.opts #{paths.join(' ')}"
|
48
|
+
"#{bundler}spec -O spec/spec.opts #{paths.join(' ')}"
|
48
49
|
end
|
49
50
|
end
|
50
51
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autospec.watchr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Timberlake
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09-
|
18
|
+
date: 2010-09-16 00:00:00 +02:00
|
19
19
|
default_executable: autospec.watchr
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|