spec/spec_helper.rb in mitamirri-0.13.8 vs spec/spec_helper.rb in mitamirri-2.0.8
- old
+ new
@@ -1,32 +1,12 @@
-require File.dirname(__FILE__) + "/custom_matchers"
-
-
ENV["RAILS_ENV"] ||= 'test'
-require "config/environment" unless defined?(RAILS_ROOT)
-require 'spec/rails'
+require File.expand_path("../../config/environment", __FILE__)
+require 'rspec/rails'
+require File.expand_path(File.dirname(__FILE__) + "/blueprints")
-pwd = File.dirname(__FILE__)
-# Requires supporting files with custom matchers and macros, etc,
-# in ./support/ and its subdirectories.
-Dir["#{pwd}/support/**/*.rb"].each {|f| require f}
+# Requires supporting ruby files with custom matchers and macros, etc,
+# in spec/support/ and its subdirectories.
+Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
-Spec::Runner.configure do |config|
- config.include(CustomMatcher)
-end
-
-# Helper methods
-
-Spec::Matchers.define :equal_the_set do |_array_2|
- match do |_array_1|
- (_array_1 - _array_2).size == 0
- end
- failure_message_for_should do |_array_1|
- "expected the sets to be the same (differences: #{(_array_1 - _array_2).inspect})"
- end
- failure_message_for_should_not do |_array_1|
- "expected the sets to be different"
- end
- description do
- "expected a two arrays to contain the same elements in any order"
- end
+RSpec.configure do |config|
+ config.mock_with :mocha
end