forked from upserve/docker-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspec_helper.rb
More file actions
44 lines (32 loc) · 1.03 KB
/
spec_helper.rb
File metadata and controls
44 lines (32 loc) · 1.03 KB
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
# frozen_string_literal: true
require 'bundler/setup'
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rspec/its'
require 'single_cov'
# avoid coverage failure from lower docker versions not running all tests
SingleCov.setup :rspec
require 'docker'
ENV['DOCKER_API_USER'] ||= 'debbie_docker'
ENV['DOCKER_API_PASS'] ||= '*************'
ENV['DOCKER_API_EMAIL'] ||= 'debbie_docker@example.com'
RSpec.shared_context "local paths" do
def project_dir
File.expand_path(File.join(File.dirname(__FILE__), '..'))
end
end
module SpecHelpers
def skip_slow_test
skip "Disabled because ENV['RUN_SLOW_TESTS'] not set" unless ENV['RUN_SLOW_TESTS']
end
def skip_without_auth
skip "Disabled because of missing auth" if ENV['DOCKER_API_USER'] == 'debbie_docker'
end
end
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
config.mock_with :rspec
config.color = true
config.formatter = :documentation
config.tty = true
config.include SpecHelpers
end