Class: Liquid::Rails::Rspec::DropMatchers::ScopeMatcher
- Inherits:
-
Object
- Object
- Liquid::Rails::Rspec::DropMatchers::ScopeMatcher
- Defined in:
- lib/liquid4-rails/rspec/drop_matchers.rb
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
- #failure_message_when_negated ⇒ Object
-
#initialize(name) ⇒ ScopeMatcher
constructor
A new instance of ScopeMatcher.
- #matches?(actual) ⇒ Boolean
Constructor Details
#initialize(name) ⇒ ScopeMatcher
Returns a new instance of ScopeMatcher.
126 127 128 |
# File 'lib/liquid4-rails/rspec/drop_matchers.rb', line 126 def initialize(name) @name = name end |
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
124 125 126 |
# File 'lib/liquid4-rails/rspec/drop_matchers.rb', line 124 def actual @actual end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
124 125 126 |
# File 'lib/liquid4-rails/rspec/drop_matchers.rb', line 124 def name @name end |
Instance Method Details
#description ⇒ Object
136 137 138 |
# File 'lib/liquid4-rails/rspec/drop_matchers.rb', line 136 def description "have scope #{name}" end |
#failure_message ⇒ Object
140 141 142 |
# File 'lib/liquid4-rails/rspec/drop_matchers.rb', line 140 def %Q{expected #{actual.inspect} to define "#{name}" as scope} end |
#failure_message_when_negated ⇒ Object
144 145 146 |
# File 'lib/liquid4-rails/rspec/drop_matchers.rb', line 144 def %Q{expected #{actual.inspect} not to define "#{name}" as scope} end |
#matches?(actual) ⇒ Boolean
130 131 132 133 134 |
# File 'lib/liquid4-rails/rspec/drop_matchers.rb', line 130 def matches?(actual) @actual = actual scopes.include?(name) end |