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

Version Path
aruba-0.14.14 spec/support/matchers/option.rb
aruba-0.14.13 spec/support/matchers/option.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/aruba-0.14.12/spec/support/matchers/option.rb
aruba-0.14.12 spec/support/matchers/option.rb
aruba-0.14.11 spec/support/matchers/option.rb
aruba-0.14.10 spec/support/matchers/option.rb
aruba-0.14.9 spec/support/matchers/option.rb
aruba-0.14.8 spec/support/matchers/option.rb
aruba-0.14.7 spec/support/matchers/option.rb
aruba-0.14.6 spec/support/matchers/option.rb
aruba-0.14.5 spec/support/matchers/option.rb
aruba-0.14.4 spec/support/matchers/option.rb
aruba-0.14.3 spec/support/matchers/option.rb
aruba-win-fix-0.14.2 spec/support/matchers/option.rb
aruba-0.14.2 spec/support/matchers/option.rb
aruba-0.14.1 spec/support/matchers/option.rb
aruba-0.14.0 spec/support/matchers/option.rb
aruba-0.13.0 spec/support/matchers/option.rb
aruba-0.12.0 spec/support/matchers/option.rb
aruba-0.11.2 spec/support/matchers/option.rb