Class: LiquidStream::Matchers::Stream
- Inherits:
-
Object
- Object
- LiquidStream::Matchers::Stream
- Defined in:
- lib/liquid_stream/matchers/stream.rb
Instance Method Summary collapse
- #as(as) ⇒ Object
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(attr_name) ⇒ Stream
constructor
A new instance of Stream.
- #matches?(klass) ⇒ Boolean
Constructor Details
#initialize(attr_name) ⇒ Stream
Returns a new instance of Stream.
4 5 6 |
# File 'lib/liquid_stream/matchers/stream.rb', line 4 def initialize(attr_name) @attr_name = attr_name end |
Instance Method Details
#as(as) ⇒ Object
13 14 15 16 |
# File 'lib/liquid_stream/matchers/stream.rb', line 13 def as(as) @as = as self end |
#description ⇒ Object
26 27 28 |
# File 'lib/liquid_stream/matchers/stream.rb', line 26 def description "Ensures that #{@klass} streams #{@attr_name}." end |
#failure_message ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/liquid_stream/matchers/stream.rb', line 18 def = %Q(expected #{@klass} to stream `#{@attr_name}`) if defined? @as += " as `#{@as}`" end end |
#matches?(klass) ⇒ Boolean
8 9 10 11 |
# File 'lib/liquid_stream/matchers/stream.rb', line 8 def matches?(klass) @klass = klass key_exists? && end |