class ArgumentSpecification::Matchers::StartWith

Attributes

expected[R]

Public Class Methods

new(expected) click to toggle source

Create a new matcher instance

Arguments:

expected: (String)

Example:

>> ArgumentSpecification::Matchers::StartWith.new("test")
=> #<ArgumentSpecification::Matchers::StartWith:0x00000000000000 @expected="test">
# File lib/argspec/matchers/start_with.rb, line 17
def initialize(expected)
  @expected = expected
end

Public Instance Methods

matches?() click to toggle source

Check if the actual object matches

Example:

>> matcher.matches?
=> true
# File lib/argspec/matchers/start_with.rb, line 27
def matches?
  @actual.start_with?(@expected)
end