spec/spec_helper.rb in 4me-sdk-1.2.0 vs spec/spec_helper.rb in 4me-sdk-2.0.0.pre.rc.1
- old
+ new
@@ -1,11 +1,10 @@
-# -*- encoding : utf-8 -*-
dir = File.dirname(__FILE__)
-$LOAD_PATH.unshift dir + '/../lib'
+$LOAD_PATH.unshift "#{dir}/../lib"
$LOAD_PATH.unshift dir
-STDERR.puts("Running specs using ruby version #{RUBY_VERSION}")
+warn("Running specs using ruby version #{RUBY_VERSION}")
require 'simplecov'
SimpleCov.start
require 'rspec'
@@ -24,16 +23,16 @@
require 'sdk4me/client'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
-Dir["#{dir}/support/**/*.rb"].each { |f| require f }
+Dir["#{dir}/support/**/*.rb"].sort.each { |f| require f }
RSpec.configure do |config|
config.before(:each) do
- log_dir = File.dirname(__FILE__) + '/log'
- Dir.mkdir(log_dir) unless File.exists?(log_dir)
+ log_dir = "#{File.dirname(__FILE__)}/log"
+ Dir.mkdir(log_dir) unless File.exist?(log_dir)
Sdk4me.configuration.logger = Logger.new("#{log_dir}/test.log")
@spec_dir = dir
@fixture_dir = "#{dir}/support/fixtures"
end
config.after(:each) { Sdk4me.configuration.reset }
@@ -41,8 +40,6 @@
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = 'random'
-
end
-