Permalink
Browse files

Got specs and features to pass on rubinius 1.1.

  • Loading branch information...
1 parent d2c0a0c commit 646eab5e86c06bcb9ea3aee263a3f7f816ade722 @myronmarston committed Oct 12, 2010
View
@@ -16,6 +16,7 @@
* Consider 0.0.0.0 to be a localhost alias (previously only "localhost" and 127.0.0.1 were considered).
* Added spec and feature coverage for Curb integration. Works out of the box with no changes required
to VCR due to [Pete Higgins](http://github.com/phiggins) great work to add Curb support to WebMock.
+* Got specs and features to pass on rubinius.
## 1.1.2 (September 9, 2010)
View
@@ -60,7 +60,7 @@ maintenance) and accurate (the response from example.com will contain the same h
* Simple cucumber integration is provided using tags.
* Known to work well with many popular ruby libraries including RSpec, Cucumber, Test::Unit, Capybara, Mechanize and
Rest-Client.
-* Extensively tested on 6 different ruby interpretters.
+* Extensively tested on 7 different ruby interpretters.
## Development
@@ -388,6 +388,7 @@ VCR has been tested on the following ruby interpreters:
* MRI 1.9.2-p0
* REE 1.8.7-2010.02
* JRuby 1.5.1
+* Rubinius 1.1
## Notes, etc.
View
@@ -4,6 +4,9 @@ Bundler::GemHelper.install_tasks
require 'rake'
require "rspec/core/rake_task"
+$LOAD_PATH.unshift 'spec'
+
+require 'support/ruby_interpreter'
RSpec::Core::RakeTask.new(:spec) do |t|
#t.rspec_opts = %w[--format documentation]
@@ -31,7 +34,7 @@ namespace :features do
namespace http_stubbing_adapter do
http_libraries.each do |http_lib|
- next if RUBY_PLATFORM == 'java' && %w( patron em-http-request curb ).include?(http_lib)
+ next if RUBY_INTERPRETER != :mri && %w( patron em-http-request curb ).include?(http_lib)
sanitized_http_lib = http_lib.gsub('/', '_')
features_subtasks << "features:#{http_stubbing_adapter}:#{sanitized_http_lib}"
@@ -19,6 +19,7 @@
puts "\n\n---------------- Running features using #{ENV['HTTP_STUBBING_ADAPTER']} and #{ENV['HTTP_LIB']} -----------------\n"
require 'vcr'
+require 'ruby_interpreter'
require 'vcr_localhost_server'
require 'fixnum_extension'
@@ -90,7 +90,8 @@ def realias(klass, method, alias_extension)
# Require all the HTTP libraries--these must be required before WebMock
# for WebMock to work with them.
require 'httpclient'
-unless RUBY_PLATFORM == 'java'
+
+if RUBY_INTERPRETER == :mri
require 'patron'
require 'em-http-request'
require 'curb'
View
@@ -2,8 +2,6 @@
require 'bundler'
Bundler.setup
-require 'vcr'
-require 'monkey_patches'
require 'rspec'
# Ruby 1.9.1 has a different yaml serialization format.
@@ -13,14 +11,17 @@
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
+require 'vcr'
+require 'monkey_patches'
+
RSpec.configure do |config|
config.extend TempCassetteLibraryDir
config.extend DisableWarnings
config.extend MonkeyPatches::RSpecMacros
config.extend WebMockMacros
config.color_enabled = true
- config.debug = RUBY_PLATFORM != 'java'
+ config.debug = RUBY_INTERPRETER == :mri
config.before(:each) do
VCR::Config.default_cassette_options = { :record => :new_episodes }
@@ -101,7 +101,7 @@ def make_http_request(method, url, body = nil, headers = {})
module HttpLibrarySpecs
def test_http_library(library, supported_request_match_attributes)
# curb, patron and em-http-client cannot be installed on jruby
- return if %w[curb patron em-http-request].include?(library) && RUBY_PLATFORM == 'java'
+ return if %w[curb patron em-http-request].include?(library) && RUBY_INTERPRETER != :mri
unless adapter_module = HTTP_LIBRARY_ADAPTERS[library]
raise ArgumentError.new("No http library adapter module could be found for #{library}")
@@ -0,0 +1,7 @@
+RUBY_INTERPRETER = if RUBY_PLATFORM == 'java'
+ :jruby
+elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
+ :rubinius
+else
+ :mri
+end
@@ -53,10 +53,7 @@ def booted?
end
def concurrently
- if RUBY_PLATFORM == 'java'
- # JRuby doesn't support forking.
- Thread.new { yield }
- else
+ if RUBY_INTERPRETER == :mri
# Patron times out when the server is running in a separate thread in the same process,
# so use a separate process.
pid = Process.fork do
@@ -72,6 +69,11 @@ def concurrently
# ignore this error...I think it means the child process has already exited.
end
end
+ else
+ # JRuby doesn't support forking.
+ # Rubinius does, but there's a weird issue with the booted? check not working,
+ # so we're just using a thread for now.
+ Thread.new { yield }
end
end

0 comments on commit 646eab5

Please sign in to comment.