diff --git a/Rakefile b/Rakefile index 235f063..4a46708 100644 --- a/Rakefile +++ b/Rakefile @@ -12,7 +12,7 @@ begin gem.authors = ["Nick Gauthier"] gem.add_development_dependency "shoulda", "= 2.10.3" gem.add_development_dependency "rspec", "= 1.3.0" - gem.add_development_dependency "cucumber", "= 0.7.2" + gem.add_development_dependency "cucumber", "= 0.8.5" gem.add_development_dependency "therubyracer", "= 0.7.4" end Jeweler::GemcutterTasks.new diff --git a/bin/warmsnake.rb b/bin/warmsnake.rb index 0fbb035..6c3caf7 100644 --- a/bin/warmsnake.rb +++ b/bin/warmsnake.rb @@ -1,62 +1,64 @@ #!/usr/bin/env ruby - -require 'rubygems' -require 'hydra' - -@files = ARGV.inject([]){|memo,f| memo += Dir.glob f} - -if @files.empty? - puts "You must specify a list of files to run" - puts "If you specify a pattern, it must be in quotes" - puts %{USAGE: #{$0} test/unit/my_test.rb "test/functional/**/*_test.rb"} - exit(1) -end - -Signal.trap("TERM", "KILL") do - puts "Warm Snake says bye bye" - exit(0) -end - -bold_yellow = "\033[1;33m" -reset = "\033[0m" - - -loop do - env_proc = Process.fork do - puts "#{bold_yellow}Booting Environment#{reset}" - start = Time.now - ENV['RAILS_ENV']='test' - require 'config/environment' - require 'test/test_helper' - finish = Time.now - puts "#{bold_yellow}Environment Booted (#{finish-start})#{reset}" - - loop do - puts "#{bold_yellow}Running#{reset} [#{@files.inspect}]" +if File.expand_path($0) == File.expand_path(__FILE__) + require 'rubygems' + require 'hydra' + + @files = ARGV.inject([]){|memo,f| memo += Dir.glob f} + + if @files.empty? + puts "You must specify a list of files to run" + puts "If you specify a pattern, it must be in quotes" + puts %{USAGE: #{$0} test/unit/my_test.rb "test/functional/**/*_test.rb"} + exit(1) + end + + Signal.trap("TERM", "KILL") do + puts "Warm Snake says bye bye" + exit(0) + end + + bold_yellow = "\033[1;33m" + reset = "\033[0m" + + + loop do + env_proc = Process.fork do + puts "#{bold_yellow}Booting Environment#{reset}" start = Time.now - Hydra::Master.new( - :files => @files.dup, - :listeners => Hydra::Listener::ProgressBar.new(STDOUT), - :workers => [{:type => :local, :runners => 4}] - ) + ENV['RAILS_ENV']='test' + require 'config/environment' + require 'test/test_helper' finish = Time.now - puts "#{bold_yellow}Tests finished#{reset} (#{finish-start})" - - puts "" - - $stdout.write "Press #{bold_yellow}ENTER#{reset} to retest. Type #{bold_yellow}r#{reset} then hit enter to reboot environment. #{bold_yellow}CTRL-C#{reset} to quit\n> " - begin - command = $stdin.gets - rescue Interrupt - exit(0) + puts "#{bold_yellow}Environment Booted (#{finish-start})#{reset}" + + loop do + puts "#{bold_yellow}Running#{reset} [#{@files.inspect}]" + start = Time.now + Hydra::Master.new( + :files => @files.dup, + :listeners => Hydra::Listener::ProgressBar.new(STDOUT), + :workers => [{:type => :local, :runners => 4}] + ) + finish = Time.now + puts "#{bold_yellow}Tests finished#{reset} (#{finish-start})" + + puts "" + + $stdout.write "Press #{bold_yellow}ENTER#{reset} to retest. Type #{bold_yellow}r#{reset} then hit enter to reboot environment. #{bold_yellow}CTRL-C#{reset} to quit\n> " + begin + command = $stdin.gets + rescue Interrupt + exit(0) + end + break if !command.nil? and command.chomp == "r" end - break if !command.nil? and command.chomp == "r" + end + begin + Process.wait env_proc + rescue Interrupt + puts "\n#{bold_yellow}SSsssSsssSSssSs#{reset}" + break end end - begin - Process.wait env_proc - rescue Interrupt - puts "\n#{bold_yellow}SSsssSsssSSssSs#{reset}" - break - end end + diff --git a/hydra.gemspec b/hydra.gemspec index 3daf4ab..9dd9eac 100644 --- a/hydra.gemspec +++ b/hydra.gemspec @@ -9,9 +9,11 @@ Gem::Specification.new do |s| s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Nick Gauthier"] - s.date = %q{2010-07-08} + s.date = %q{2010-08-20} + s.default_executable = %q{warmsnake.rb} s.description = %q{Spread your tests over multiple machines to test your code faster.} s.email = %q{nick@smartlogicsolutions.com} + s.executables = ["warmsnake.rb"] s.extra_rdoc_files = [ "LICENSE", "README.rdoc", @@ -25,6 +27,7 @@ Gem::Specification.new do |s| "Rakefile", "TODO", "VERSION", + "bin/warmsnake.rb", "caliper.yml", "hydra-icon-64x64.png", "hydra.gemspec", @@ -110,18 +113,18 @@ Gem::Specification.new do |s| if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then s.add_development_dependency(%q, ["= 2.10.3"]) s.add_development_dependency(%q, ["= 1.3.0"]) - s.add_development_dependency(%q, ["= 0.7.2"]) + s.add_development_dependency(%q, ["= 0.8.5"]) s.add_development_dependency(%q, ["= 0.7.4"]) else s.add_dependency(%q, ["= 2.10.3"]) s.add_dependency(%q, ["= 1.3.0"]) - s.add_dependency(%q, ["= 0.7.2"]) + s.add_dependency(%q, ["= 0.8.5"]) s.add_dependency(%q, ["= 0.7.4"]) end else s.add_dependency(%q, ["= 2.10.3"]) s.add_dependency(%q, ["= 1.3.0"]) - s.add_dependency(%q, ["= 0.7.2"]) + s.add_dependency(%q, ["= 0.8.5"]) s.add_dependency(%q, ["= 0.7.4"]) end end diff --git a/lib/hydra/cucumber/formatter.rb b/lib/hydra/cucumber/formatter.rb index 6812f0f..cc35acf 100644 --- a/lib/hydra/cucumber/formatter.rb +++ b/lib/hydra/cucumber/formatter.rb @@ -19,7 +19,6 @@ module Cucumber #:nodoc: print_steps(:failed) print_snippets(@options) print_passing_wip(@options) - print_tag_limit_warnings(features) end # Removed all progress output