-
Notifications
You must be signed in to change notification settings - Fork 71
/
spec_helper.rb
72 lines (54 loc) · 1.67 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
require "candy_check"
require "candy_check/cli"
def in_continuous_integration_environment?
ENV["CI"] || ENV["TRAVIS"] || ENV["CONTINUOUS_INTEGRATION"]
end
require "simplecov"
SimpleCov.start do
if in_continuous_integration_environment?
require "simplecov-lcov"
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = "coverage/lcov.info"
end
formatter SimpleCov::Formatter::LcovFormatter
end
end
require "minitest/autorun"
require "minitest/around/spec"
require "minitest/focus" unless in_continuous_integration_environment?
require "webmock/minitest"
require "vcr"
require "timecop"
require "pry"
require_relative "support/with_fixtures"
require_relative "support/with_temp_file"
require_relative "support/with_command"
ENV["DEBUG"] && Google::APIClient.logger.level = Logger::DEBUG
class MiniTest::Spec
class << self
alias :context :describe
end
end
module MiniTest
module Assertions
# The first parameter must be ```true```, not coercible to true.
def assert_true(obj, msg = nil)
msg = message(msg) { "<true> expected but was #{mu_pp obj}" }
assert obj == true, msg
end
# The first parameter must be ```false```, not just coercible to false.
def assert_false(obj, msg = nil)
msg = message(msg) { "<false> expected but was #{mu_pp obj}" }
assert obj == false, msg
end
end
module Expectations
infect_an_assertion :assert_true, :must_be_true, :unary
infect_an_assertion :assert_false, :must_be_false, :unary
end
end
VCR.configure do |config|
config.cassette_library_dir = "spec/fixtures/vcr_cassettes"
config.hook_into :webmock
end