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 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", "= 1.3.0"
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.20.0
1
+ 0.21.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hydra}
8
- s.version = "0.20.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-20}
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>, ["= 1.3.0"])
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>, ["= 1.3.0"])
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>, ["= 1.3.0"])
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
@@ -107,7 +107,7 @@ module Hydra #:nodoc:
107
107
  def run_rspec_file(file)
108
108
  # pull in rspec
109
109
  begin
110
- require 'spec'
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
- Spec::Runner.options.instance_variable_set(:@formatters, [
119
- Spec::Runner::Formatter::HydraFormatter.new(
120
- Spec::Runner.options.formatter_options,
121
- hydra_output
122
- )
123
- ])
124
- Spec::Runner.options.instance_variable_set(
125
- :@example_groups, []
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,12 +1,3 @@
1
- if defined?(Spec)
2
- module Spec
3
- module Runner
4
- class << self
5
- # stop the auto-run at_exit
6
- def run
7
- return 0
8
- end
9
- end
10
- end
11
- end
1
+ if defined?(RSpec)
2
+ RSpec::Core::Runner.disable_autorun!
12
3
  end
@@ -1,14 +1,23 @@
1
- require 'spec/runner/formatter/progress_bar_formatter'
2
- module Spec
3
- module Runner
4
- module Formatter
5
- class HydraFormatter < ProgressBarFormatter
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 the output of pending examples
11
- def example_pending(*args)
19
+ # Stifle pending specs
20
+ def dump_pending
12
21
  end
13
22
  end
14
23
  end
@@ -1,5 +1,5 @@
1
1
  require 'tmpdir'
2
- require 'spec'
2
+ require 'rspec'
3
3
  context "file writing" do
4
4
  it "writes to a file" do
5
5
  File.open(File.join(Dir.tmpdir, 'alternate_hydra_test.txt'), 'a') do |f|
@@ -1,5 +1,5 @@
1
1
  require 'tmpdir'
2
- require 'spec'
2
+ require 'rspec'
3
3
  context "file writing" do
4
4
  it "writes to a file" do
5
5
  File.open(File.join(Dir.tmpdir, 'hydra_test.txt'), 'a') do |f|
@@ -1,5 +1,5 @@
1
1
  require 'tmpdir'
2
- require 'spec'
2
+ require 'rspec'
3
3
  context "file writing" do
4
4
  it "writes to a file" do
5
5
  File.open(File.join(Dir.tmpdir, 'hydra_test.txt'), 'a') do |f|
@@ -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
- - 20
7
+ - 21
8
8
  - 0
9
- version: 0.20.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-20 00:00:00 -04:00
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
- - 1
43
- - 3
42
+ - 2
43
+ - 0
44
44
  - 0
45
- version: 1.3.0
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