Sha256: 15f2403557b7f6714ce157c6ecdd8bbfa59a1ba89a05f415c384220a49140ff8
Contents?: true
Size: 1.45 KB
Versions: 2
Compression:
Stored size: 1.45 KB
Contents
# Configure Rails Environment ENV["RAILS_ENV"] = "test" require File.expand_path("../dummy/config/environment.rb", __FILE__) $dir = File.dirname(File.expand_path(__FILE__)) require 'rspec/rails' require 'rexml/document' # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support and it's subdirectories Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f } RSpec.configure do |config| config.expect_with :rspec do |c| c.syntax = :expect end config.before(:suite) do # Make sure we can run redis if !system("which redis-server") puts '', "** can't find `redis-server` in your path" abort '' end # Start redis puts "Starting redis for testing at localhost:9736" `redis-server #{$dir}/support/redis/redis-test.conf` QuickbooksWebConnector.redis = 'localhost:9736' end config.before(:each) do QuickbooksWebConnector.redis.flushall QuickbooksWebConnector.reset_configuration! end # Kill our own redis we started config.after(:suite) do processes = `ps -A -o pid,command | grep [r]edis-test`.split($/) pids = processes.map { |process| process.split(" ")[0] } puts '', "Killing test redis server..." pids.each { |pid| Process.kill("TERM", pid.to_i) } system("rm -f #{$dir}/support/redis/dump.rdb") end end # fixture classes class SomeBuilder def self.perform(*args) end end class SomeHandler def self.perform(response_xml, *args) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
quickbooks_web_connector-0.6.1 | spec/spec_helper.rb |
quickbooks_web_connector-0.6.0 | spec/spec_helper.rb |