forked from chicago-tool-library/circulate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_helper.rb
38 lines (31 loc) · 982 Bytes
/
test_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
ENV["RAILS_ENV"] ||= "test"
require_relative "../config/environment"
require "rails/test_help"
require "spy/integration"
require "minitest/mock"
require "helpers/return_values"
class ActiveSupport::TestCase
# Run tests in parallel with specified workers
parallelize(workers: :number_of_processors)
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here...
include FactoryBot::Syntax::Methods
def assert_size(expected, subject)
assert_equal expected, subject.size, "wrong size; got #{subject.size} instead of #{expected}"
end
class << self
def env_tags
@env_tags ||= ENV.fetch("TAGS", "").split
end
def test(subject, *tags, &block)
if tags.include?(:remote) && !env_tags.include?("remote")
super subject do
skip "Skipping remote test"
end
else
super(subject, &block)
end
end
end
end