I use spork to test the Sinatra application, and with Ruby 1.9.2, tests run after about 3.5 seconds, but in Ruby 1.8.7 an average of 1.2 seconds. I really tried Ruby 1.9.3 and even JRuby, but they had some gem errors that I use. Is there a way to bring the performance of Ruby 1.9.2 rspec to 1.8.7?
My gemfile:
source :rubygems gem 'sinatra', '1.3.1' gem 'thin', '1.3.1' gem 'haml', '3.1.4' gem 'datamapper', '1.2.0' gem 'dm-postgres-adapter', '1.2.0' gem 'carrierwave', '0.5.8' gem 'carrierwave-datamapper', '0.2.0' group :test do gem "dm-sqlite-adapter" gem "spork" gem "rspec" gem "rack-test" end
spec_helper.rb:
require 'rubygems' require 'spork' require 'sinatra' require 'rack/test' require 'rspec' require File.join(File.dirname(__FILE__), '..', 'app.rb') require File.join(File.dirname(__FILE__), '..', 'model/model.rb') Spork.prefork do set :environment, :test set :files, "test_files" end Spork.each_run do RSpec.configure do |config| config.before(:each) { DataMapper.auto_migrate! } config.after(:all) do FileUtils.rm_rf(Dir["#{settings.root}/public/test_files"]) end end end
thanks!
source share