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
|
require 'rspec'
require 'buff/ruby_engine'
require 'json_spec'
require 'pathname'
def setup_rspec
RSpec.configure do |config|
config.include JsonSpec::Helpers
config.expect_with :rspec do |c|
c.syntax = :expect
end
config.mock_with :rspec
config.filter_run focus: true
config.run_all_when_everything_filtered = true
config.before(:each) { clean_tmp_path }
end
end
def app_root
@app_root ||= Pathname.new(File.expand_path('../../', __FILE__))
end
def clean_tmp_path
FileUtils.rm_rf(tmp_path)
FileUtils.mkdir_p(tmp_path)
end
def tmp_path
app_root.join('spec', 'tmp')
end
if true
require 'buff/config'
setup_rspec
else
require 'spork'
Spork.prefork { setup_rspec }
Spork.each_run { require 'buff/config' }
end
|