Sha256: 58121414c94f10ed1374c411b31bb35fa29893b95c40c4176ffc3a6cf4df45b7
Contents?: true
Size: 925 Bytes
Versions: 38
Compression:
Stored size: 925 Bytes
Contents
RSpec::Matchers.define :be_valid_option do |_| match do |actual| subject.option?(actual) end failure_message do |actual| format("expected that \"%s\" is a valid option", actual) end failure_message_when_negated do |actual| format("expected that \"%s\" is not a valid option", actual) end end RSpec::Matchers.define :have_option_value do |expected| match do |actual| @old_actual = actual @actual = if RUBY_VERSION < '1.9' subject.send(actual.to_sym) else subject.public_send(actual.to_sym) end values_match? expected, @actual end diffable failure_message do |_actual| format(%(expected that option "%s" has value "%s"), @old_actual, expected) end failure_message_when_negated do |_actual| format(%(expected that option "%s" does not have value "%s"), @old_actual, expected) end end
Version data entries
38 entries across 38 versions & 3 rubygems