hydra 0.20.0 → 0.21.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/hydra.gemspec +5 -5
- data/lib/hydra/runner.rb +10 -17
- data/lib/hydra/spec/autorun_override.rb +2 -11
- data/lib/hydra/spec/hydra_formatter.rb +16 -7
- data/test/fixtures/write_file_alternate_spec.rb +1 -1
- data/test/fixtures/write_file_spec.rb +1 -1
- data/test/fixtures/write_file_with_pending_spec.rb +1 -1
- data/test/runner_test.rb +2 -1
- metadata +8 -6
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/ngauthier/hydra"
|
12
12
|
gem.authors = ["Nick Gauthier"]
|
13
13
|
gem.add_development_dependency "shoulda", "= 2.10.3"
|
14
|
-
gem.add_development_dependency "rspec", "=
|
14
|
+
gem.add_development_dependency "rspec", "= 2.0.0.beta.19"
|
15
15
|
gem.add_development_dependency "cucumber", "= 0.8.5"
|
16
16
|
gem.add_development_dependency "therubyracer", "= 0.7.4"
|
17
17
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.21.0
|
data/hydra.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{hydra}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.21.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Nick Gauthier"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-23}
|
13
13
|
s.default_executable = %q{warmsnake.rb}
|
14
14
|
s.description = %q{Spread your tests over multiple machines to test your code faster.}
|
15
15
|
s.email = %q{nick@smartlogicsolutions.com}
|
@@ -112,18 +112,18 @@ Gem::Specification.new do |s|
|
|
112
112
|
|
113
113
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
114
114
|
s.add_development_dependency(%q<shoulda>, ["= 2.10.3"])
|
115
|
-
s.add_development_dependency(%q<rspec>, ["=
|
115
|
+
s.add_development_dependency(%q<rspec>, ["= 2.0.0.beta.19"])
|
116
116
|
s.add_development_dependency(%q<cucumber>, ["= 0.8.5"])
|
117
117
|
s.add_development_dependency(%q<therubyracer>, ["= 0.7.4"])
|
118
118
|
else
|
119
119
|
s.add_dependency(%q<shoulda>, ["= 2.10.3"])
|
120
|
-
s.add_dependency(%q<rspec>, ["=
|
120
|
+
s.add_dependency(%q<rspec>, ["= 2.0.0.beta.19"])
|
121
121
|
s.add_dependency(%q<cucumber>, ["= 0.8.5"])
|
122
122
|
s.add_dependency(%q<therubyracer>, ["= 0.7.4"])
|
123
123
|
end
|
124
124
|
else
|
125
125
|
s.add_dependency(%q<shoulda>, ["= 2.10.3"])
|
126
|
-
s.add_dependency(%q<rspec>, ["=
|
126
|
+
s.add_dependency(%q<rspec>, ["= 2.0.0.beta.19"])
|
127
127
|
s.add_dependency(%q<cucumber>, ["= 0.8.5"])
|
128
128
|
s.add_dependency(%q<therubyracer>, ["= 0.7.4"])
|
129
129
|
end
|
data/lib/hydra/runner.rb
CHANGED
@@ -107,7 +107,7 @@ module Hydra #:nodoc:
|
|
107
107
|
def run_rspec_file(file)
|
108
108
|
# pull in rspec
|
109
109
|
begin
|
110
|
-
require '
|
110
|
+
require 'rspec'
|
111
111
|
require 'hydra/spec/hydra_formatter'
|
112
112
|
# Ensure we override rspec's at_exit
|
113
113
|
require 'hydra/spec/autorun_override'
|
@@ -115,22 +115,15 @@ module Hydra #:nodoc:
|
|
115
115
|
return ex.to_s
|
116
116
|
end
|
117
117
|
hydra_output = StringIO.new
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
Spec::Runner.options.instance_variable_set(
|
128
|
-
:@files, [file]
|
129
|
-
)
|
130
|
-
Spec::Runner.options.instance_variable_set(
|
131
|
-
:@files_loaded, false
|
132
|
-
)
|
133
|
-
Spec::Runner.options.run_examples
|
118
|
+
|
119
|
+
config = [
|
120
|
+
'-f', 'RSpec::Core::Formatters::HydraFormatter',
|
121
|
+
file
|
122
|
+
]
|
123
|
+
|
124
|
+
RSpec.instance_variable_set(:@world, nil)
|
125
|
+
RSpec::Core::Runner.run(config, hydra_output, hydra_output)
|
126
|
+
|
134
127
|
hydra_output.rewind
|
135
128
|
output = hydra_output.read.chomp
|
136
129
|
output = "" if output.gsub("\n","") =~ /^\.*$/
|
@@ -1,14 +1,23 @@
|
|
1
|
-
require '
|
2
|
-
module
|
3
|
-
module
|
4
|
-
module
|
5
|
-
class HydraFormatter <
|
1
|
+
require 'rspec/core/formatters/progress_formatter'
|
2
|
+
module RSpec
|
3
|
+
module Core
|
4
|
+
module Formatters
|
5
|
+
class HydraFormatter < ProgressFormatter
|
6
|
+
def example_passed(example)
|
7
|
+
end
|
8
|
+
|
9
|
+
def example_pending(example)
|
10
|
+
end
|
11
|
+
|
12
|
+
def example_failed(example)
|
13
|
+
end
|
14
|
+
|
6
15
|
# Stifle the post-test summary
|
7
16
|
def dump_summary(duration, example, failure, pending)
|
8
17
|
end
|
9
18
|
|
10
|
-
# Stifle
|
11
|
-
def
|
19
|
+
# Stifle pending specs
|
20
|
+
def dump_pending
|
12
21
|
end
|
13
22
|
end
|
14
23
|
end
|
data/test/runner_test.rb
CHANGED
@@ -50,6 +50,7 @@ class RunnerTest < Test::Unit::TestCase
|
|
50
50
|
end
|
51
51
|
|
52
52
|
should "run two rspec tests" do
|
53
|
+
puts "First test"
|
53
54
|
runner = Hydra::Runner.new(:io => File.new('/dev/null', 'w'))
|
54
55
|
runner.run_file(rspec_file)
|
55
56
|
assert File.exists?(target_file)
|
@@ -60,7 +61,7 @@ class RunnerTest < Test::Unit::TestCase
|
|
60
61
|
runner.run_file(alternate_rspec_file)
|
61
62
|
assert File.exists?(alternate_target_file)
|
62
63
|
assert_equal "HYDRA", File.read(alternate_target_file)
|
63
|
-
assert !File.exists?(target_file)
|
64
|
+
assert !File.exists?(target_file), "Tests are double running!"
|
64
65
|
end
|
65
66
|
|
66
67
|
should "run rspec tests with pending examples" do
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 21
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.21.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Nick Gauthier
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-23 00:00:00 -04:00
|
18
18
|
default_executable: warmsnake.rb
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -39,10 +39,12 @@ dependencies:
|
|
39
39
|
- - "="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
segments:
|
42
|
-
-
|
43
|
-
-
|
42
|
+
- 2
|
43
|
+
- 0
|
44
44
|
- 0
|
45
|
-
|
45
|
+
- beta
|
46
|
+
- 19
|
47
|
+
version: 2.0.0.beta.19
|
46
48
|
type: :development
|
47
49
|
version_requirements: *id002
|
48
50
|
- !ruby/object:Gem::Dependency
|