gorgon 0.4.0.rc1 → 0.4.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gorgon (0.4.0.rc1)
4
+ gorgon (0.4.0.rc2)
5
5
  amqp (~> 0.9.7)
6
6
  awesome_print
7
7
  bunny (~> 0.8.0)
@@ -1,3 +1,3 @@
1
1
  module Gorgon
2
- VERSION = "0.4.0.rc1"
2
+ VERSION = "0.4.0.rc2"
3
3
  end
data/lib/gorgon/worker.rb CHANGED
@@ -125,7 +125,7 @@ class Worker
125
125
  def test_framework(filename)
126
126
  if filename =~ /_spec.rb$/i && defined?(RSpec)
127
127
  :rspec
128
- elsif defined?(MiniTest)
128
+ elsif defined?(MiniTest) && !test_unit_gem?
129
129
  :mini_test
130
130
  elsif defined?(Test)
131
131
  :test_unit
@@ -134,6 +134,12 @@ class Worker
134
134
  end
135
135
  end
136
136
 
137
+ # Is the user using test-unit gem?
138
+ def test_unit_gem?
139
+ gemfile_lock = "./Gemfile.lock"
140
+ File.exists?(gemfile_lock) && File.read(gemfile_lock).scan(/\btest-unit/).any?
141
+ end
142
+
137
143
  def make_start_message(filename)
138
144
  {:action => :start, :hostname => Socket.gethostname, :worker_id => @worker_id, :filename => filename}
139
145
  end
data/spec/worker_spec.rb CHANGED
@@ -166,9 +166,10 @@ few lines of output and send it to originator. Order matters" do
166
166
  # ruby 1.9 defines MiniTest by default, so let's remove it for these test cases
167
167
  Object.send(:remove_const, :MiniTest)
168
168
  file_queue.stub!(:pop).and_return("file_test.rb", nil)
169
+ File.stub!(:read).and_return("")
169
170
  end
170
171
 
171
- it "runs file using TestUnitRunner when file doesn't ends in _spec and Test is defined" do
172
+ it "runs file using TestUnitRunner when file doesn't end in _spec and Test is defined" do
172
173
  stub_const("Test", :test_unit)
173
174
 
174
175
  @worker.should_receive(:require_relative).with "test_unit_runner"
@@ -194,6 +195,17 @@ few lines of output and send it to originator. Order matters" do
194
195
  @worker.work
195
196
  end
196
197
 
198
+ it "runs file using TestUnitRunner when file doesn't end in _spec.rb, MiniTest is defined but project is using test-unit gem" do
199
+ MiniTest = Temp
200
+ File.stub!(:read).and_return("test-unit")
201
+ stub_const("Test", :test_unit)
202
+
203
+ @worker.should_receive(:require_relative).with "test_unit_runner"
204
+ TestRunner.should_receive(:run_file).with("file_test.rb", TestUnitRunner).and_return({})
205
+
206
+ @worker.work
207
+ end
208
+
197
209
  it "uses UnknownRunner if the framework is unknown" do
198
210
  stub_const("UnknownRunner", :unknown_runner)
199
211
  file_queue.stub!(:pop).and_return("file.rb", nil)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gorgon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.rc1
4
+ version: 0.4.0.rc2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -278,7 +278,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
278
278
  version: '0'
279
279
  segments:
280
280
  - 0
281
- hash: -2658024620569548158
281
+ hash: -864570023472014297
282
282
  required_rubygems_version: !ruby/object:Gem::Requirement
283
283
  none: false
284
284
  requirements: