spec/spec_helper.rb in dbf-3.0.0 vs spec/spec_helper.rb in dbf-3.0.1

- old
+ new

@@ -7,22 +7,26 @@ require 'dbf' require 'yaml' require 'rspec' require 'fileutils' -Encoding.default_external = "UTF-8" if defined?(Encoding) +RSpec.configure do |config| + config.disable_monkey_patching! + config.warnings = true + config.order = :random -DB_PATH = File.dirname(__FILE__) + '/fixtures' unless defined?(DB_PATH) + config.expect_with :rspec do |expectations| + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end -RSpec.configure do |config| - def ruby_supports_mathn? - begin - require 'mathn' - rescue UnsupportedLibraryError - false - end + config.mock_with :rspec do |mocks| + mocks.verify_partial_doubles = true end end -def fixture_path(filename) - "#{DB_PATH}/#{filename}" +def fixture_path + @fixture_path ||= File.join(File.dirname(__FILE__), '/fixtures') +end + +def fixture(filename) + File.join(fixture_path, filename) end