From c641828c02d339f8cbaacefa10c249d27fcc6dda Mon Sep 17 00:00:00 2001 From: Vitor Baptista Date: Thu, 16 Aug 2012 17:37:28 -0300 Subject: [PATCH] Fixes Redis' mocking. --- Gemfile.lock | 2 +- config/environments/cucumber.rb | 2 -- config/environments/test.rb | 2 -- features/support/env.rb | 1 + spec/spec_helper.rb | 2 ++ 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 6b19d14..167eda0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -101,7 +101,7 @@ DEPENDENCIES json_pure (= 1.4.6) jtrupiano-timecop (= 0.2.1) mime-types (= 1.16) - mock_redis + mock_redis (= 0.4.1) mysql2 (= 0.2.18) newrelic_rpm (= 3.3.0) paperclip (= 2.3.1) diff --git a/config/environments/cucumber.rb b/config/environments/cucumber.rb index 3084799..4b4365f 100644 --- a/config/environments/cucumber.rb +++ b/config/environments/cucumber.rb @@ -21,8 +21,6 @@ config.action_controller.allow_forgery_protection = false # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test -$redis = MockRedis.new - HOST = "localhost" AUTHORIZE_NET_API_LOGIN_ID = '' AUTHORIZE_NET_TRANSACTION_KEY = '' diff --git a/config/environments/test.rb b/config/environments/test.rb index 3f182f1..2931bcc 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -21,8 +21,6 @@ config.action_controller.allow_forgery_protection = false # ActionMailer::Base.deliveries array. config.action_mailer.delivery_method = :test -$redis = MockRedis.new - HOST = 'localhost' AUTHORIZE_NET_API_LOGIN_ID = '' diff --git a/features/support/env.rb b/features/support/env.rb index 536cac8..631b145 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -21,6 +21,7 @@ Webrat.configure do |config| config.open_error_files = false # Set to true if you want error pages to pop up in the browser end +$redis = MockRedis.new # If you set this to false, any error raised from within your app will bubble # up to your step definition and out to cucumber unless you catch it somewhere diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1836a87..604a98f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -9,6 +9,8 @@ require 'spec/rails' # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} +$redis = MockRedis.new + Spec::Runner.configure do |config| # If you're not using ActiveRecord you should remove these # lines, delete config/database.yml and disable :active_record -- libgit2 0.21.2