Skip to content

Commit

Permalink
Refactor: Remove unused test helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdefreyne committed Oct 30, 2017
1 parent 4e8cc2a commit f5be7e0
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ def if_have(*libs)
yield
end

def if_implemented
yield
rescue NotImplementedError, NameError
skip $ERROR_INFO
return
end

def with_site(params = {})
# Build site name
site_name = params[:name]
Expand Down Expand Up @@ -122,13 +115,6 @@ def with_site(params = {})
end

def setup
# Check skipped
if ENV['skip']
if ENV['skip'].split(',').include?(self.class.to_s)
skip 'manually skipped'
end
end

# Clean up
GC.start

Expand Down Expand Up @@ -215,28 +201,6 @@ def assert_examples_correct(object)
end
end

def assert_contains_exactly(expected, actual)
assert_equal(
expected.size,
actual.size,
format('Expected %s to be of same size as %s', actual.inspect, expected.inspect),
)
remaining = actual.dup.to_a
expected.each do |e|
index = remaining.index(e)
remaining.delete_at(index) if index
end
assert(
remaining.empty?,
format('Expected %s to contain all the elements of %s', actual.inspect, expected.inspect),
)
end

def assert_raises_frozen_error
error = assert_raises(RuntimeError, TypeError) { yield }
assert_match(/(^can't modify frozen |^unable to modify frozen object$)/, error.message)
end

def with_env_vars(hash, &_block)
orig_env_hash = ENV.to_hash
hash.each_pair { |k, v| ENV[k] = v }
Expand Down

0 comments on commit f5be7e0

Please sign in to comment.