Skip to content

Commit

Permalink
Fix spec_helper for RSpec 2
Browse files Browse the repository at this point in the history
  • Loading branch information
kjvarga committed Jan 10, 2012
1 parent 4f4a834 commit b69f2f4
Showing 1 changed file with 7 additions and 33 deletions.
40 changes: 7 additions & 33 deletions spec/spec_helper.rb
@@ -1,44 +1,18 @@
ENV['RAILS_ENV'] ||= 'test'
require "bundler/setup"

# sitemap_rails =
# case ENV["SITEMAP_RAILS"]
# when 'rails3'
# "mock_rails3_gem"
# when 'gem', 'plugin'
# "mock_app_#{ENV["SITEMAP_RAILS"]}"
# else
# "mock_app_gem"
# end
#
# ENV["RAILS_ENV"] ||= 'test'
# ENV['BUNDLE_GEMFILE'] = File.join(File.dirname(__FILE__), sitemap_rails, 'Gemfile')
#
# # Load the app's Rakefile so we know everything is being loaded correctly
# load(File.join(File.dirname(__FILE__), sitemap_rails, 'Rakefile'))
Bundler.require
require 'rspec/autorun'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}

require 'sitemap_generator'

Spec::Runner.configure do |config|
RSpec.configure do |config|
config.mock_with :mocha
config.include(FileMacros)
config.include(XmlMacros)
end

module Helpers
extend self

# Invoke and then re-enable the task so it can be called multiple times.
# KJV: Tasks are only being run once despite being re-enabled.
#
# <tt>task</tt> task symbol/string
def invoke_task(task)
Rake.send(:verbose, false)
Rake::Task[task.to_s].invoke
Rake::Task[task.to_s].reenable
end
# Pass :focus option to +describe+ or +it+ to run that spec only
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus => true
config.run_all_when_everything_filtered = true
end

0 comments on commit b69f2f4

Please sign in to comment.