test/helper.rb in nanoc-4.8.11 vs test/helper.rb in nanoc-4.8.12
- old
+ new
@@ -47,17 +47,10 @@
end
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]
if site_name.nil?
@site_num ||= 0
@@ -120,17 +113,10 @@
yield Nanoc::Int::SiteLoader.new.new_from_cwd
end
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
# Go quiet
unless ENV['QUIET'] == 'false'
@@ -211,31 +197,9 @@
actual_out,
"Incorrect example:\n#{pair.first}",
)
end
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 }