module GovukAbTesting::MinitestAssertions

Public Instance Methods

assert_contains_substring(string:, substring:, error_message:) click to toggle source
# File lib/govuk_ab_testing/minitest_assertions.rb, line 7
def assert_contains_substring(string:, substring:, error_message:)
  assert_match(/#{substring}/, string, error_message)
end
assert_does_not_contain_substring(string:, substring:, error_message:) click to toggle source
# File lib/govuk_ab_testing/minitest_assertions.rb, line 11
def assert_does_not_contain_substring(string:, substring:, error_message:)
  refute_match(/#{substring}/, string, error_message)
end
assert_has_size(enumerable:, size:, error_message:) click to toggle source
# File lib/govuk_ab_testing/minitest_assertions.rb, line 15
def assert_has_size(enumerable:, size:, error_message:)
  assert_equal(size, enumerable.count, error_message)
end
assert_is_empty(enumerable:, error_message:) click to toggle source
# File lib/govuk_ab_testing/minitest_assertions.rb, line 19
def assert_is_empty(enumerable:, error_message:)
  assert_has_size(enumerable: enumerable, size: 0, error_message: error_message)
end
assert_is_equal(expected:, actual:, error_message:) click to toggle source
# File lib/govuk_ab_testing/minitest_assertions.rb, line 3
def assert_is_equal(expected:, actual:, error_message:)
  assert_equal(expected, actual, error_message)
end
assert_not_blank(string:, error_message:) click to toggle source
# File lib/govuk_ab_testing/minitest_assertions.rb, line 23
def assert_not_blank(string:, error_message:)
  refute_nil(string, error_message)
  refute_equal(string.length, 0, error_message)
end