Class: RSpec::Matchers::BuiltIn::StartWith
- Inherits:
-
StartAndEndWith
- Object
- BaseMatcher
- StartAndEndWith
- RSpec::Matchers::BuiltIn::StartWith
- Defined in:
- lib/rspec/matchers/built_in/start_and_end_with.rb
Instance Attribute Summary
Attributes inherited from BaseMatcher
#actual, #expected, #rescued_exception
Instance Method Summary collapse
Methods inherited from StartAndEndWith
#failure_message_for_should, #failure_message_for_should_not, #initialize, #matches?
Methods inherited from BaseMatcher
#==, #description, #diffable?, #failure_message_for_should, #failure_message_for_should_not, #initialize, #match_unless_raises, #matches?
Methods included from Pretty
#_pretty_print, #expected_to_sentence, #name, #name_to_sentence, #split_words, #to_sentence, #underscore
Constructor Details
This class inherits a constructor from RSpec::Matchers::BuiltIn::StartAndEndWith
Instance Method Details
#element_matches?(expected, actual) ⇒ Boolean
32 33 34 |
# File 'lib/rspec/matchers/built_in/start_and_end_with.rb', line 32 def element_matches?(expected, actual) @actual[0] == @expected end |
#subset_matches?(expected, actual) ⇒ Boolean
28 29 30 |
# File 'lib/rspec/matchers/built_in/start_and_end_with.rb', line 28 def subset_matches?(expected, actual) actual[0, expected.length] == expected end |