Permalink
Browse files

Fixes Redis' mocking.

We need to require mock_redis before calling MockRedis.new inside
config/environments/*.rb. This because, inside that, Bundler haven't required
our environments' gems yet.

This patch moves that to spec/spec_helper.rb and features/support/env.rb. This
fixes this problem, and also mocks Redis even if we don't run the tests through
Rake.

I also forgot to commit the Gemfile.lock. Adding this here.
  • Loading branch information...
1 parent 266e73b commit c641828c02d339f8cbaacefa10c249d27fcc6dda @vitorbaptista vitorbaptista committed Aug 16, 2012
Showing with 4 additions and 5 deletions.
  1. +1 −1 Gemfile.lock
  2. +0 −2 config/environments/cucumber.rb
  3. +0 −2 config/environments/test.rb
  4. +1 −0 features/support/env.rb
  5. +2 −0 spec/spec_helper.rb
View
@@ -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)
@@ -21,8 +21,6 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
-$redis = MockRedis.new
-
HOST = "localhost"
AUTHORIZE_NET_API_LOGIN_ID = ''
AUTHORIZE_NET_TRANSACTION_KEY = ''
@@ -21,8 +21,6 @@
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
-$redis = MockRedis.new
-
HOST = 'localhost'
AUTHORIZE_NET_API_LOGIN_ID = ''
@@ -21,6 +21,7 @@
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
View
@@ -9,6 +9,8 @@
# 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

0 comments on commit c641828

Please sign in to comment.