Skip to content

Commit

Permalink
Make sure tests still run in JRuby, where Curb isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisk committed Nov 27, 2009
1 parent 168423d commit 346a8e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -15,7 +15,7 @@ begin
gem.authors = ["Chris Kampmeier", "Blaine Cook"]
gem.homepage = "http://github.com/chrisk/fakeweb"
gem.add_development_dependency "mocha", ">= 0.9.5"
gem.add_development_dependency "curb", ">= 0.5.4"
gem.add_development_dependency "curb", ">= 0.5.9.1" unless RUBY_PLATFORM =~ /java/
end
Jeweler::GemcutterTasks.new
Jeweler::RubyforgeTasks.new do |rubyforge|
Expand Down
7 changes: 6 additions & 1 deletion test/test_curb.rb
Expand Up @@ -72,4 +72,9 @@ def test_perform_raises_when_body_handler_returns_non_number
assert warning.include? "test_curb.rb:#{line}: warning: Curl data handlers should return the number of bytes read as an Integer\n"
end

end
end

if RUBY_PLATFORM =~ /java/
puts "Skipping Curb tests (running under JRuby)"
Object.send(:remove_const, :TestCurb)
end
2 changes: 1 addition & 1 deletion test/test_helper.rb
Expand Up @@ -3,8 +3,8 @@
require 'pathname'
require 'rbconfig'
require 'rubygems'
require 'curb'
require 'mocha'
require 'curb' unless RUBY_PLATFORM =~ /java/

require 'fake_web'

Expand Down

0 comments on commit 346a8e4

Please sign in to comment.