spec/spec_helper.rb in ns-yapi-0.5.0 vs spec/spec_helper.rb in ns-yapi-0.6.0
- old
+ new
@@ -1,52 +1,47 @@
+# frozen_string_literal: true
+
+require 'ns_client'
require 'simplecov'
SimpleCov.start
require 'coveralls'
Coveralls.wear!
+require 'pry'
-require 'httpclient'
-
require 'mocha/api'
require 'webmock/rspec'
require 'timecop'
spec_helper = Pathname.new(__FILE__).realpath
-lib_path = File.expand_path("../../lib", spec_helper)
-$:.unshift(lib_path)
+lib_path = File.expand_path('../../lib', spec_helper)
+$LOAD_PATH.unshift(lib_path)
##############################################################
# Configure rspec
RSpec.configure do |config|
- config.order = "random"
+ config.order = 'random'
config.after(:each) do
Timecop.return # make sure timecop is disabled after each test
end
- config.treat_symbols_as_metadata_keys_with_true_values = true
- config.filter_run :focus => true
+ config.filter_run focus: true
config.run_all_when_everything_filtered = true
- unless config.inclusion_filter[:integration]
- p "Integration specs are DISABLED. To run integration specs only, use `rspec --tag integration`"
- config.filter_run_excluding :integration => true
+ if config.inclusion_filter[:integration]
+ p 'Running integrtion specs ONLY.'
else
- p "Running integrtion specs ONLY."
+ p 'Integration specs are DISABLED. To run integration specs only, use `rspec --tag integration`'
+ config.filter_run_excluding integration: true
end
-
end
# END
##############################################################
-$ROOT = File.expand_path("../", lib_path)
-Dir.glob(File.join(lib_path, '/**/*.rb')).each do |file|
- require file
-end
-
# helper methods for easier testing
def load_fixture(filename)
- File.read(File.join($ROOT, "spec/fixtures/#{filename}"))
+ File.read(File.join(File.dirname(__FILE__), "/fixtures/#{filename}"))
end