/
spec_helper.rb
48 lines (41 loc) · 1.32 KB
/
spec_helper.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
require 'rubygems'
require 'bundler'
begin
Bundler.setup(:default, :development, :test)
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
exit e.status_code
end
unless ENV['CI']
require 'simplecov'
SimpleCov.start do
add_filter '/spec/'
end
end
require 'rspec/autorun'
require 'webmock/rspec'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'eventful-ruby'
require 'pathname'
config_file = Pathname.new(File.join(File.dirname(__FILE__), 'config.yml'))
if config_file.exist?
config = YAML.load_file(config_file.to_s)
Eventful.api_key = config['api_key']
Eventful.feed_key = config['feed_key']
else
abort "Please setup a spec/config.yml file"
end
RSpec.configure do |config|
config.filter_run focus: true
config.run_all_when_everything_filtered = true
# 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
# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}