class Representable::Matchers::ParseStrategyMatcher
Public Instance Methods
description()
click to toggle source
# File lib/matchers/parse_strategy_matcher.rb, line 11 def description "only allow representable collection to use a specific parse strategy" end
failure_message_for_should()
click to toggle source
# File lib/matchers/parse_strategy_matcher.rb, line 15 def failure_message_for_should "Expected #{expectation}" end
failure_message_for_should_not()
click to toggle source
# File lib/matchers/parse_strategy_matcher.rb, line 19 def failure_message_for_should_not "Did not expect #{expectation}" end
matches?(subject)
click to toggle source
# File lib/matchers/parse_strategy_matcher.rb, line 6 def matches?(subject) @subject = subject matches_strategy? end
Private Instance Methods
expectation()
click to toggle source
# File lib/matchers/parse_strategy_matcher.rb, line 29 def expectation "#{@subject.class} to be a kind of #{strategy}" end
matches_strategy?()
click to toggle source
# File lib/matchers/parse_strategy_matcher.rb, line 25 def matches_strategy? @subject.send(:representable_attrs)[property].options[:parse_strategy] == strategy end