require File.dirname(__FILE__) + "/custom_matchers" ENV["RAILS_ENV"] ||= 'test' require "config/environment" unless defined?(RAILS_ROOT) require 'spec/rails' 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} 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 end