soundcheck 0.2.4.beta1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -0
- data/.travis.yml +3 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +7 -0
- data/README.markdown +61 -0
- data/VERSION +1 -1
- data/bin/soundcheck +1 -1
- data/fixtures/null-project/.gitkeep +0 -0
- data/fixtures/ruby-minitest/Rakefile +5 -0
- data/fixtures/ruby-minitest/test/foo_test.rb +0 -0
- data/lib/soundcheck/frameworks/cucumber.rb +33 -0
- data/lib/soundcheck/frameworks/expresso.rb +29 -0
- data/lib/soundcheck/frameworks/minitest.rb +47 -0
- data/lib/soundcheck/frameworks/rspec.rb +45 -0
- data/lib/soundcheck/frameworks/ruby_cutest.rb +26 -0
- data/lib/soundcheck/frameworks.rb +16 -145
- data/lib/soundcheck/languages.rb +5 -6
- data/soundcheck.gemspec +16 -4
- data/spec/soundcheck/frameworks/minitest_spec.rb +45 -0
- data/spec/soundcheck/frameworks/rspec_spec.rb +3 -3
- metadata +37 -17
- data/spec/soundcheck_spec.rb +0 -41
data/.rspec
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -11,6 +11,10 @@ GEM
|
|
11
11
|
json (>= 1.4.6)
|
12
12
|
term-ansicolor (>= 1.0.6)
|
13
13
|
diff-lcs (1.1.3)
|
14
|
+
fuubar (0.0.6)
|
15
|
+
rspec (~> 2.0)
|
16
|
+
rspec-instafail (~> 0.1.8)
|
17
|
+
ruby-progressbar (~> 0.0.10)
|
14
18
|
gherkin (2.5.4)
|
15
19
|
json (>= 1.4.6)
|
16
20
|
git (1.2.5)
|
@@ -29,7 +33,9 @@ GEM
|
|
29
33
|
rspec-core (2.7.1)
|
30
34
|
rspec-expectations (2.7.0)
|
31
35
|
diff-lcs (~> 1.1.2)
|
36
|
+
rspec-instafail (0.1.9)
|
32
37
|
rspec-mocks (2.7.0)
|
38
|
+
ruby-progressbar (0.0.10)
|
33
39
|
term-ansicolor (1.0.7)
|
34
40
|
|
35
41
|
PLATFORMS
|
@@ -38,6 +44,7 @@ PLATFORMS
|
|
38
44
|
DEPENDENCIES
|
39
45
|
activesupport (~> 3.0)
|
40
46
|
cucumber
|
47
|
+
fuubar
|
41
48
|
jeweler (~> 1.6.4)
|
42
49
|
rcov
|
43
50
|
rspec
|
data/README.markdown
CHANGED
@@ -10,6 +10,67 @@ $filename`, and soundcheck will figure out how to run that test.
|
|
10
10
|
|
11
11
|
Soundcheck will also try to run your tests as fast as possible.
|
12
12
|
|
13
|
+
## Usage
|
14
|
+
|
15
|
+
```
|
16
|
+
soundcheck
|
17
|
+
=> runs all tests it can find
|
18
|
+
|
19
|
+
soundcheck spec
|
20
|
+
=> runs rspec tests
|
21
|
+
|
22
|
+
soundcheck --fast spec
|
23
|
+
=> runs only rspec tests that don't require spec_helper
|
24
|
+
|
25
|
+
soundcheck spec/models/user_spec.rb
|
26
|
+
=> runs that specific test
|
27
|
+
```
|
28
|
+
|
29
|
+
## How I use it with Vim
|
30
|
+
|
31
|
+
```vim
|
32
|
+
function! RunTests(filename)
|
33
|
+
" Write the file and run tests for the given filename
|
34
|
+
:w
|
35
|
+
:silent !echo;echo;echo;echo;echo;echo;echo;echo;echo;echo
|
36
|
+
" For terminal Vim:
|
37
|
+
exec ":!soundcheck " . a:filename
|
38
|
+
|
39
|
+
" For graphical Vim:
|
40
|
+
"call Send_to_Tmux("soundcheck " . a:filename . "\n")
|
41
|
+
endfunction
|
42
|
+
|
43
|
+
function! SetTestFile()
|
44
|
+
" Set the spec file that tests will be run for.
|
45
|
+
let t:grb_test_file=@%
|
46
|
+
endfunction
|
47
|
+
|
48
|
+
function! RunTestFile(...)
|
49
|
+
if a:0
|
50
|
+
let command_suffix = a:1
|
51
|
+
else
|
52
|
+
let command_suffix = ""
|
53
|
+
endif
|
54
|
+
|
55
|
+
" Run the tests for the previously-marked file.
|
56
|
+
let in_test_file = match(expand("%"), '\(.feature\|_spec.rb\)$') != -1
|
57
|
+
if in_test_file
|
58
|
+
call SetTestFile()
|
59
|
+
elseif !exists("t:grb_test_file")
|
60
|
+
return
|
61
|
+
end
|
62
|
+
call RunTests(t:grb_test_file . command_suffix)
|
63
|
+
endfunction
|
64
|
+
|
65
|
+
function! RunNearestTest()
|
66
|
+
let spec_line_number = line('.')
|
67
|
+
call RunTestFile(":" . spec_line_number)
|
68
|
+
endfunction
|
69
|
+
|
70
|
+
map <leader>t :call RunTestFile()<cr>
|
71
|
+
map <leader>a :call RunTests('')<cr>
|
72
|
+
```
|
73
|
+
|
13
74
|
## Is Soundcheck not working for your project?
|
14
75
|
|
15
76
|
Feel free to submit a pull request that adds only a fixture and RSpec testcase
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/bin/soundcheck
CHANGED
File without changes
|
File without changes
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Frameworks
|
2
|
+
class Cucumber
|
3
|
+
include Frameworks::Base
|
4
|
+
|
5
|
+
def present?
|
6
|
+
project.has_file?("features")
|
7
|
+
end
|
8
|
+
|
9
|
+
def filter(*args)
|
10
|
+
args.select { |arg| arg =~ /\.feature$/ }
|
11
|
+
end
|
12
|
+
|
13
|
+
def default_args
|
14
|
+
["features"]
|
15
|
+
end
|
16
|
+
|
17
|
+
def command(*args)
|
18
|
+
args = (args.empty? ? default_args : filter(*args))
|
19
|
+
return nil if args.empty?
|
20
|
+
|
21
|
+
to_run = []
|
22
|
+
to_run << "bundle exec" if has_gemfile?
|
23
|
+
to_run << "cucumber #{args.join(" ")}".strip
|
24
|
+
to_run.join(" ")
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
def has_gemfile?
|
30
|
+
project.has_file?("Gemfile")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Frameworks
|
2
|
+
class Expresso
|
3
|
+
include Frameworks::Base
|
4
|
+
|
5
|
+
def present?
|
6
|
+
project.has_file?("test/*.js")
|
7
|
+
end
|
8
|
+
|
9
|
+
def filter(*args)
|
10
|
+
filter_with(args, {
|
11
|
+
:is_js_file => /\.js$/
|
12
|
+
})
|
13
|
+
end
|
14
|
+
|
15
|
+
def default_args
|
16
|
+
["test/*"]
|
17
|
+
end
|
18
|
+
|
19
|
+
def command(*args)
|
20
|
+
args = (args.empty? ? default_args : filter(*args))
|
21
|
+
return nil if args.empty?
|
22
|
+
|
23
|
+
local_expresso = "node_modules/expresso/bin/expresso"
|
24
|
+
expresso_bin = project.has_file?(local_expresso) ? local_expresso : "expresso"
|
25
|
+
|
26
|
+
"#{expresso_bin} --include lib #{args.join(" ")}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Frameworks
|
2
|
+
class Minitest
|
3
|
+
include Frameworks::Base
|
4
|
+
|
5
|
+
def present?
|
6
|
+
project.has_file?("test")
|
7
|
+
end
|
8
|
+
|
9
|
+
def filter(*args)
|
10
|
+
filter_with(args, {
|
11
|
+
:is_test_file => /_test\.rb$/,
|
12
|
+
:is_in_test_dir => /^test/,
|
13
|
+
:is_dir => lambda {|arg| project.has_dir?(arg) }
|
14
|
+
})
|
15
|
+
end
|
16
|
+
|
17
|
+
def command(*args)
|
18
|
+
# If we were given args, but none of them are minitest files,
|
19
|
+
# then we skip minitest
|
20
|
+
return if not args.empty? and filter(*args).empty?
|
21
|
+
args = filter(*args)
|
22
|
+
|
23
|
+
# rake test can either run a single file, or all of them,
|
24
|
+
# so if we're given more than one, just run all
|
25
|
+
args = [] if args.length > 1
|
26
|
+
args = args.map {|i| "TEST=#{i}" }
|
27
|
+
|
28
|
+
to_run = []
|
29
|
+
to_run << "bundle exec" if has_gemfile?
|
30
|
+
to_run << "rake test"
|
31
|
+
to_run << "-t" if options[:trace]
|
32
|
+
to_run << args.join(" ")
|
33
|
+
to_run.join(" ").strip
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def has_test_dir?
|
39
|
+
project.has_dir?("test")
|
40
|
+
end
|
41
|
+
|
42
|
+
def has_gemfile?
|
43
|
+
project.has_file?("Gemfile")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Frameworks
|
2
|
+
class RSpec
|
3
|
+
include Frameworks::Base
|
4
|
+
|
5
|
+
def present?
|
6
|
+
project.has_file?("spec")
|
7
|
+
end
|
8
|
+
|
9
|
+
def filter(*args)
|
10
|
+
filter_with(args, {
|
11
|
+
:is_spec_file => /_spec\.rb$/,
|
12
|
+
:is_in_spec_dir => /^spec/,
|
13
|
+
:is_dir => lambda {|arg| project.has_dir?(arg) }
|
14
|
+
})
|
15
|
+
end
|
16
|
+
|
17
|
+
def default_args
|
18
|
+
["spec"]
|
19
|
+
end
|
20
|
+
|
21
|
+
def command(*args)
|
22
|
+
args = (args.empty? ? default_args : filter(*args))
|
23
|
+
return nil if args.empty?
|
24
|
+
|
25
|
+
to_run = []
|
26
|
+
to_run << "bundle exec" if has_gemfile? and requires_spec_helper?(*args)
|
27
|
+
to_run << "rspec"
|
28
|
+
to_run << "-b" if options[:trace]
|
29
|
+
to_run << "--format=doc" if args.size < 2 and args != default_args
|
30
|
+
to_run << args.join(" ")
|
31
|
+
to_run.join(" ").strip
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def requires_spec_helper?(*args)
|
37
|
+
output, status = project.execute("grep -r 'spec_helper' #{args.join(" ")}")
|
38
|
+
status.exitstatus == 0 # matched
|
39
|
+
end
|
40
|
+
|
41
|
+
def has_gemfile?
|
42
|
+
project.has_file?("Gemfile")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Frameworks
|
2
|
+
class RubyCutest
|
3
|
+
include Frameworks::Base
|
4
|
+
|
5
|
+
def present?
|
6
|
+
project.has_file?("Rakefile") and project.file_contents("Rakefile") =~ /Cutest\.run/
|
7
|
+
end
|
8
|
+
|
9
|
+
def filter(*args)
|
10
|
+
filter_with(args, {
|
11
|
+
:is_in_test_dir => /^test\//
|
12
|
+
})
|
13
|
+
end
|
14
|
+
|
15
|
+
def default_args
|
16
|
+
["test/*.rb"]
|
17
|
+
end
|
18
|
+
|
19
|
+
def command(*args)
|
20
|
+
args = (args.empty? ? default_args : filter(*args))
|
21
|
+
return nil if args.empty?
|
22
|
+
|
23
|
+
"cutest #{args.join(" ")}".strip
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'active_support/deprecation'
|
1
2
|
require 'active_support/concern'
|
2
3
|
require 'soundcheck/logging'
|
3
4
|
|
@@ -15,156 +16,26 @@ module Frameworks
|
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
raise "Unknown filter type for #{value}"
|
30
|
-
end
|
19
|
+
def filter_with(args, filters)
|
20
|
+
logger.debug "Filtering #{args.inspect}"
|
21
|
+
args.select do |arg|
|
22
|
+
filters.any? do |key, value|
|
23
|
+
case value
|
24
|
+
when Regexp
|
25
|
+
arg =~ value
|
26
|
+
when Proc
|
27
|
+
value.call(arg)
|
28
|
+
else
|
29
|
+
raise "Unknown filter type for #{value}"
|
31
30
|
end
|
32
31
|
end
|
33
32
|
end
|
34
|
-
|
35
|
-
def to_s
|
36
|
-
self.class.name.split("::").last
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
class RSpec
|
42
|
-
include Frameworks::Base
|
43
|
-
|
44
|
-
def present?
|
45
|
-
project.has_file?("spec")
|
46
|
-
end
|
47
|
-
|
48
|
-
def filter(*args)
|
49
|
-
filter_with(args, {
|
50
|
-
:is_spec_file => /_spec\.rb$/,
|
51
|
-
:is_in_spec_dir => /^spec/,
|
52
|
-
:is_dir => lambda {|arg| project.has_dir?(arg) }
|
53
|
-
})
|
54
|
-
end
|
55
|
-
|
56
|
-
def default_args
|
57
|
-
["spec"]
|
58
|
-
end
|
59
|
-
|
60
|
-
def command(*args)
|
61
|
-
args = (args.empty? ? default_args : filter(*args))
|
62
|
-
return nil if args.empty?
|
63
|
-
|
64
|
-
to_run = []
|
65
|
-
to_run << "bundle exec" if has_gemfile? and requires_spec_helper?(*args)
|
66
|
-
to_run << "rspec"
|
67
|
-
to_run << "-b" if options[:trace]
|
68
|
-
to_run << args.join(" ")
|
69
|
-
to_run.join(" ").strip
|
70
|
-
end
|
71
|
-
|
72
|
-
private
|
73
|
-
|
74
|
-
def requires_spec_helper?(*args)
|
75
|
-
output, status = project.execute("grep -r 'spec_helper' #{args.join(" ")}")
|
76
|
-
status.exitstatus == 0 # matched
|
77
|
-
end
|
78
|
-
|
79
|
-
def has_gemfile?
|
80
|
-
project.has_file?("Gemfile")
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
class Cucumber
|
85
|
-
include Frameworks::Base
|
86
|
-
|
87
|
-
def present?
|
88
|
-
project.has_file?("features")
|
89
|
-
end
|
90
|
-
|
91
|
-
def filter(*args)
|
92
|
-
args.select { |arg| arg =~ /\.feature$/ }
|
93
|
-
end
|
94
|
-
|
95
|
-
def default_args
|
96
|
-
["features"]
|
97
|
-
end
|
98
|
-
|
99
|
-
def command(*args)
|
100
|
-
args = (args.empty? ? default_args : filter(*args))
|
101
|
-
return nil if args.empty?
|
102
|
-
|
103
|
-
to_run = []
|
104
|
-
to_run << "bundle exec" if has_gemfile?
|
105
|
-
to_run << "cucumber #{args.join(" ")}".strip
|
106
|
-
to_run.join(" ")
|
107
|
-
end
|
108
|
-
|
109
|
-
private
|
110
|
-
|
111
|
-
def requires_spec_helper?(*args)
|
112
|
-
output, status = project.execute("grep -r 'spec_helper' #{args.join(" ")}")
|
113
|
-
status.exitstatus == 0 # matched
|
114
33
|
end
|
115
34
|
|
116
|
-
def
|
117
|
-
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
class RubyCutest
|
122
|
-
include Frameworks::Base
|
123
|
-
|
124
|
-
def present?
|
125
|
-
project.has_file?("Rakefile") and project.file_contents("Rakefile") =~ /Cutest\.run/
|
126
|
-
end
|
127
|
-
|
128
|
-
def filter(*args)
|
129
|
-
filter_with(args, {
|
130
|
-
:is_in_test_dir => /^test\//
|
131
|
-
})
|
132
|
-
end
|
133
|
-
|
134
|
-
def default_args
|
135
|
-
["test/*.rb"]
|
136
|
-
end
|
137
|
-
|
138
|
-
def command(*args)
|
139
|
-
args = (args.empty? ? default_args : filter(*args))
|
140
|
-
return nil if args.empty?
|
141
|
-
|
142
|
-
"cutest #{args.join(" ")}".strip
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
class Expresso
|
147
|
-
include Frameworks::Base
|
148
|
-
|
149
|
-
def present?
|
150
|
-
project.has_file?("test/*.js")
|
151
|
-
end
|
152
|
-
|
153
|
-
def filter(*args)
|
154
|
-
filter_with(args, {
|
155
|
-
:is_js_file => /\.js$/
|
156
|
-
})
|
157
|
-
end
|
158
|
-
|
159
|
-
def default_args
|
160
|
-
["test/*"]
|
161
|
-
end
|
162
|
-
|
163
|
-
def command(*args)
|
164
|
-
args = (args.empty? ? default_args : filter(*args))
|
165
|
-
return nil if args.empty?
|
166
|
-
|
167
|
-
"expresso --include lib #{args.join(" ")}"
|
35
|
+
def to_s
|
36
|
+
self.class.name.split("::").last
|
168
37
|
end
|
169
38
|
end
|
170
39
|
end
|
40
|
+
|
41
|
+
Dir[File.join(File.expand_path(File.dirname(__FILE__)), 'frameworks/*.rb')].each {|f| require f}
|
data/lib/soundcheck/languages.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'active_support/deprecation'
|
1
2
|
require 'active_support/concern'
|
2
3
|
require 'soundcheck/frameworks'
|
3
4
|
|
@@ -13,11 +14,9 @@ module Languages
|
|
13
14
|
end
|
14
15
|
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
framework.new(project).present?
|
20
|
-
end
|
17
|
+
def frameworks
|
18
|
+
known_frameworks.select do |framework|
|
19
|
+
framework.new(project).present?
|
21
20
|
end
|
22
21
|
end
|
23
22
|
end
|
@@ -26,7 +25,7 @@ module Languages
|
|
26
25
|
include Base
|
27
26
|
|
28
27
|
def known_frameworks
|
29
|
-
[ Frameworks::RSpec, Frameworks::Cucumber, Frameworks::RubyCutest ]
|
28
|
+
[ Frameworks::RSpec, Frameworks::Cucumber, Frameworks::Minitest, Frameworks::RubyCutest ]
|
30
29
|
end
|
31
30
|
end
|
32
31
|
|
data/soundcheck.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "soundcheck"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Marten Veldthuis"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2012-07-17"
|
13
13
|
s.description = "Soundcheck tries to figure out what kind of project you're working on, what test file you're trying to run, and what the fastest way is to run that."
|
14
14
|
s.email = "marten@veldthuis.com"
|
15
15
|
s.executables = ["soundcheck"]
|
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.files = [
|
21
21
|
".document",
|
22
22
|
".rspec",
|
23
|
+
".travis.yml",
|
23
24
|
"Gemfile",
|
24
25
|
"Gemfile.lock",
|
25
26
|
"LICENSE.txt",
|
@@ -31,6 +32,7 @@ Gem::Specification.new do |s|
|
|
31
32
|
"features/step_definitions/steps.rb",
|
32
33
|
"fixtures/node-expresso/package.json",
|
33
34
|
"fixtures/node-expresso/test/expresso.js",
|
35
|
+
"fixtures/null-project/.gitkeep",
|
34
36
|
"fixtures/ruby-bundler-rspec/Gemfile",
|
35
37
|
"fixtures/ruby-bundler-rspec/Gemfile.lock",
|
36
38
|
"fixtures/ruby-bundler-rspec/spec/spec_helper.rb",
|
@@ -43,6 +45,8 @@ Gem::Specification.new do |s|
|
|
43
45
|
"fixtures/ruby-cucumber/features/cucumber.feature",
|
44
46
|
"fixtures/ruby-cutest/Rakefile",
|
45
47
|
"fixtures/ruby-cutest/test/foo.rb",
|
48
|
+
"fixtures/ruby-minitest/Rakefile",
|
49
|
+
"fixtures/ruby-minitest/test/foo_test.rb",
|
46
50
|
"fixtures/ruby-rspec-exception/Rakefile",
|
47
51
|
"fixtures/ruby-rspec-exception/spec/spec_helper.rb",
|
48
52
|
"fixtures/ruby-rspec-exception/spec/with_spec_helper_spec.rb",
|
@@ -54,18 +58,23 @@ Gem::Specification.new do |s|
|
|
54
58
|
"fixtures/ruby-unknown-framework/Gemfile",
|
55
59
|
"lib/soundcheck.rb",
|
56
60
|
"lib/soundcheck/frameworks.rb",
|
61
|
+
"lib/soundcheck/frameworks/cucumber.rb",
|
62
|
+
"lib/soundcheck/frameworks/expresso.rb",
|
63
|
+
"lib/soundcheck/frameworks/minitest.rb",
|
64
|
+
"lib/soundcheck/frameworks/rspec.rb",
|
65
|
+
"lib/soundcheck/frameworks/ruby_cutest.rb",
|
57
66
|
"lib/soundcheck/languages.rb",
|
58
67
|
"lib/soundcheck/logging.rb",
|
59
68
|
"lib/soundcheck/project.rb",
|
60
69
|
"soundcheck.gemspec",
|
61
70
|
"spec/soundcheck/frameworks/cucumber_spec.rb",
|
62
71
|
"spec/soundcheck/frameworks/expresso_spec.rb",
|
72
|
+
"spec/soundcheck/frameworks/minitest_spec.rb",
|
63
73
|
"spec/soundcheck/frameworks/rspec_spec.rb",
|
64
74
|
"spec/soundcheck/frameworks/ruby_cutest_spec.rb",
|
65
75
|
"spec/soundcheck/frameworks_spec.rb",
|
66
76
|
"spec/soundcheck/languages_spec.rb",
|
67
77
|
"spec/soundcheck/project_spec.rb",
|
68
|
-
"spec/soundcheck_spec.rb",
|
69
78
|
"spec/spec_helper.rb"
|
70
79
|
]
|
71
80
|
s.homepage = "http://github.com/marten/soundcheck"
|
@@ -83,12 +92,14 @@ Gem::Specification.new do |s|
|
|
83
92
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
84
93
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
85
94
|
s.add_development_dependency(%q<cucumber>, [">= 0"])
|
95
|
+
s.add_development_dependency(%q<fuubar>, [">= 0"])
|
86
96
|
else
|
87
97
|
s.add_dependency(%q<activesupport>, ["~> 3.0"])
|
88
98
|
s.add_dependency(%q<rspec>, [">= 0"])
|
89
99
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
90
100
|
s.add_dependency(%q<rcov>, [">= 0"])
|
91
101
|
s.add_dependency(%q<cucumber>, [">= 0"])
|
102
|
+
s.add_dependency(%q<fuubar>, [">= 0"])
|
92
103
|
end
|
93
104
|
else
|
94
105
|
s.add_dependency(%q<activesupport>, ["~> 3.0"])
|
@@ -96,6 +107,7 @@ Gem::Specification.new do |s|
|
|
96
107
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
97
108
|
s.add_dependency(%q<rcov>, [">= 0"])
|
98
109
|
s.add_dependency(%q<cucumber>, [">= 0"])
|
110
|
+
s.add_dependency(%q<fuubar>, [">= 0"])
|
99
111
|
end
|
100
112
|
end
|
101
113
|
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require_relative '../../spec_helper'
|
2
|
+
require 'soundcheck/project'
|
3
|
+
require 'soundcheck/frameworks'
|
4
|
+
|
5
|
+
describe "Frameworks" do
|
6
|
+
let(:project) { Project.new(fixture("null-project")) }
|
7
|
+
|
8
|
+
describe "Minitest" do
|
9
|
+
let(:framework) { Frameworks::Minitest.new(project) }
|
10
|
+
|
11
|
+
it "should find the minitest framework" do
|
12
|
+
project.stub!(:root => fixture("ruby-minitest"))
|
13
|
+
framework.present?.should be_true
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should not find when not there" do
|
17
|
+
framework.present?.should be_false
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should work with no args" do
|
21
|
+
framework.command().should == "rake test"
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should not do anything when args contain no cutest files" do
|
25
|
+
framework.command("features/a.feature").should == nil
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should work with multiple args" do
|
29
|
+
cmd = framework.command("test/a_test.rb", "test/b_test.rb")
|
30
|
+
cmd.should == "rake test"
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should work with a single arg" do
|
34
|
+
cmd = framework.command("test/a_test.rb")
|
35
|
+
cmd.should == "rake test TEST=test/a_test.rb"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should filter invalid non-cutest args" do
|
39
|
+
cmd = framework.command("test/a_test.rb", "features/a.feature")
|
40
|
+
cmd.should == "rake test TEST=test/a_test.rb"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
|
@@ -33,12 +33,12 @@ describe "Frameworks" do
|
|
33
33
|
it "should not use bundler when not needed" do
|
34
34
|
project.stub!(:root => fixture("ruby-bundler-rspec"))
|
35
35
|
cmd = framework.command("spec/without_spec_helper_spec.rb")
|
36
|
-
cmd.should == "rspec spec/without_spec_helper_spec.rb"
|
36
|
+
cmd.should == "rspec --format=doc spec/without_spec_helper_spec.rb"
|
37
37
|
end
|
38
38
|
|
39
39
|
it "should show backtraces when requested" do
|
40
40
|
framework.options[:trace] = true
|
41
|
-
framework.command("spec/a_spec.rb").should == "rspec -b spec/a_spec.rb"
|
41
|
+
framework.command("spec/a_spec.rb").should == "rspec -b --format=doc spec/a_spec.rb"
|
42
42
|
end
|
43
43
|
|
44
44
|
it "should only run fast specs when requested" do pending
|
@@ -59,7 +59,7 @@ describe "Frameworks" do
|
|
59
59
|
|
60
60
|
it "should filter invalid non-spec args" do
|
61
61
|
cmd = framework.command("spec/a_spec.rb", "features/a.feature")
|
62
|
-
cmd.should == "rspec spec/a_spec.rb"
|
62
|
+
cmd.should == "rspec --format=doc spec/a_spec.rb"
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
metadata
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soundcheck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Marten Veldthuis
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-07-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &70173214253440 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70173214253440
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70173214252340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70173214252340
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: jeweler
|
38
|
-
requirement: &
|
38
|
+
requirement: &70173214251500 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.6.4
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70173214251500
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rcov
|
49
|
-
requirement: &
|
49
|
+
requirement: &70173214250420 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70173214250420
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: cucumber
|
60
|
-
requirement: &
|
60
|
+
requirement: &70173214249340 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,18 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70173214249340
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: fuubar
|
71
|
+
requirement: &70173214248480 !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70173214248480
|
69
80
|
description: Soundcheck tries to figure out what kind of project you're working on,
|
70
81
|
what test file you're trying to run, and what the fastest way is to run that.
|
71
82
|
email: marten@veldthuis.com
|
@@ -78,6 +89,7 @@ extra_rdoc_files:
|
|
78
89
|
files:
|
79
90
|
- .document
|
80
91
|
- .rspec
|
92
|
+
- .travis.yml
|
81
93
|
- Gemfile
|
82
94
|
- Gemfile.lock
|
83
95
|
- LICENSE.txt
|
@@ -89,6 +101,7 @@ files:
|
|
89
101
|
- features/step_definitions/steps.rb
|
90
102
|
- fixtures/node-expresso/package.json
|
91
103
|
- fixtures/node-expresso/test/expresso.js
|
104
|
+
- fixtures/null-project/.gitkeep
|
92
105
|
- fixtures/ruby-bundler-rspec/Gemfile
|
93
106
|
- fixtures/ruby-bundler-rspec/Gemfile.lock
|
94
107
|
- fixtures/ruby-bundler-rspec/spec/spec_helper.rb
|
@@ -101,6 +114,8 @@ files:
|
|
101
114
|
- fixtures/ruby-cucumber/features/cucumber.feature
|
102
115
|
- fixtures/ruby-cutest/Rakefile
|
103
116
|
- fixtures/ruby-cutest/test/foo.rb
|
117
|
+
- fixtures/ruby-minitest/Rakefile
|
118
|
+
- fixtures/ruby-minitest/test/foo_test.rb
|
104
119
|
- fixtures/ruby-rspec-exception/Rakefile
|
105
120
|
- fixtures/ruby-rspec-exception/spec/spec_helper.rb
|
106
121
|
- fixtures/ruby-rspec-exception/spec/with_spec_helper_spec.rb
|
@@ -112,18 +127,23 @@ files:
|
|
112
127
|
- fixtures/ruby-unknown-framework/Gemfile
|
113
128
|
- lib/soundcheck.rb
|
114
129
|
- lib/soundcheck/frameworks.rb
|
130
|
+
- lib/soundcheck/frameworks/cucumber.rb
|
131
|
+
- lib/soundcheck/frameworks/expresso.rb
|
132
|
+
- lib/soundcheck/frameworks/minitest.rb
|
133
|
+
- lib/soundcheck/frameworks/rspec.rb
|
134
|
+
- lib/soundcheck/frameworks/ruby_cutest.rb
|
115
135
|
- lib/soundcheck/languages.rb
|
116
136
|
- lib/soundcheck/logging.rb
|
117
137
|
- lib/soundcheck/project.rb
|
118
138
|
- soundcheck.gemspec
|
119
139
|
- spec/soundcheck/frameworks/cucumber_spec.rb
|
120
140
|
- spec/soundcheck/frameworks/expresso_spec.rb
|
141
|
+
- spec/soundcheck/frameworks/minitest_spec.rb
|
121
142
|
- spec/soundcheck/frameworks/rspec_spec.rb
|
122
143
|
- spec/soundcheck/frameworks/ruby_cutest_spec.rb
|
123
144
|
- spec/soundcheck/frameworks_spec.rb
|
124
145
|
- spec/soundcheck/languages_spec.rb
|
125
146
|
- spec/soundcheck/project_spec.rb
|
126
|
-
- spec/soundcheck_spec.rb
|
127
147
|
- spec/spec_helper.rb
|
128
148
|
homepage: http://github.com/marten/soundcheck
|
129
149
|
licenses:
|
@@ -140,13 +160,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
140
160
|
version: '0'
|
141
161
|
segments:
|
142
162
|
- 0
|
143
|
-
hash:
|
163
|
+
hash: 3227260553618328212
|
144
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
145
165
|
none: false
|
146
166
|
requirements:
|
147
|
-
- - ! '
|
167
|
+
- - ! '>='
|
148
168
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
169
|
+
version: '0'
|
150
170
|
requirements: []
|
151
171
|
rubyforge_project:
|
152
172
|
rubygems_version: 1.8.11
|
data/spec/soundcheck_spec.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require_relative 'spec_helper'
|
2
|
-
require File.expand_path(File.dirname(__FILE__) + '/../lib/soundcheck')
|
3
|
-
|
4
|
-
CURRENT_PWD = Dir.pwd
|
5
|
-
|
6
|
-
def cmd_for(path = nil, options = {})
|
7
|
-
Soundcheck.new(path, options).command_to_run
|
8
|
-
end
|
9
|
-
|
10
|
-
describe "Soundcheck" do
|
11
|
-
context "for a ruby project" do
|
12
|
-
context "using rspec" do
|
13
|
-
before(:all) { Dir.chdir(FIXTURES_ROOT + '/ruby-rspec') }
|
14
|
-
|
15
|
-
it "should not use bundler when no Gemfile exists" do
|
16
|
-
cmd_for.should == "rspec spec"
|
17
|
-
end
|
18
|
-
|
19
|
-
context "using bundler" do
|
20
|
-
before(:all) { Dir.chdir(FIXTURES_ROOT + '/ruby-bundler-rspec') }
|
21
|
-
|
22
|
-
it "should return 'bundle exec rspec spec' when run with no arguments" do
|
23
|
-
cmd_for.should == "bundle exec rspec spec"
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should return 'bundle exec rspec spec/with_spec_helper_spec.rb'" do
|
27
|
-
cmd_for('spec/with_spec_helper_spec.rb').should == "bundle exec rspec spec/with_spec_helper_spec.rb"
|
28
|
-
end
|
29
|
-
|
30
|
-
it "should return 'rspec spec/without_spec_helper_spec.rb'" do
|
31
|
-
cmd_for('spec/without_spec_helper_spec.rb').should == "rspec spec/without_spec_helper_spec.rb"
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
context "using minitest"
|
37
|
-
context "using test::unit"
|
38
|
-
end
|
39
|
-
|
40
|
-
context "for a python project"
|
41
|
-
end
|