Class: Funktional::FlashedAssertion

Inherits:
Assertion
  • Object
show all
Defined in:
lib/funktional/flashed_assertion.rb

Instance Method Summary collapse

Constructor Details

#initialize(symbol) ⇒ FlashedAssertion

Returns a new instance of FlashedAssertion.



3
4
5
# File 'lib/funktional/flashed_assertion.rb', line 3

def initialize(symbol)
  @symbol = symbol
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Funktional::Assertion

Instance Method Details

#should_be(expected_value) ⇒ Object



7
8
9
10
# File 'lib/funktional/flashed_assertion.rb', line 7

def should_be(expected_value)
  assert_not_nil flash[@symbol], "Flash is empty [#{expected_value}] expected."
  assert_equal expected_value, flash[@symbol]
end