Class: RSpecFixtures::ApprovalHandler
- Inherits:
-
Object
- Object
- RSpecFixtures::ApprovalHandler
- Includes:
- Colsole
- Defined in:
- lib/rspec_fixtures/approval_handler.rb
Overview
Handles user input and interactive fixture approvals
Instance Attribute Summary collapse
-
#actual ⇒ Object
readonly
Returns the value of attribute actual.
-
#expected ⇒ Object
readonly
Returns the value of attribute expected.
-
#fixture_file ⇒ Object
readonly
Returns the value of attribute fixture_file.
Instance Method Summary collapse
Instance Attribute Details
#actual ⇒ Object (readonly)
Returns the value of attribute actual.
12 13 14 |
# File 'lib/rspec_fixtures/approval_handler.rb', line 12 def actual @actual end |
#expected ⇒ Object (readonly)
Returns the value of attribute expected.
12 13 14 |
# File 'lib/rspec_fixtures/approval_handler.rb', line 12 def expected @expected end |
#fixture_file ⇒ Object (readonly)
Returns the value of attribute fixture_file.
12 13 14 |
# File 'lib/rspec_fixtures/approval_handler.rb', line 12 def fixture_file @fixture_file end |
Instance Method Details
#run(expected, actual, fixture_file) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/rspec_fixtures/approval_handler.rb', line 14 def run(expected, actual, fixture_file) @expected = expected @actual = actual @fixture_file = fixture_file show expected.empty? ? actual : diff prompt_user end |