Class: Transpec::Syntax::RaiseError::RecordBuilder
- Inherits:
-
RecordBuilder
- Object
- RecordBuilder
- Transpec::Syntax::RaiseError::RecordBuilder
- Defined in:
- lib/transpec/syntax/raise_error.rb
Instance Attribute Summary collapse
-
#raise_error ⇒ Object
readonly
Returns the value of attribute raise_error.
Instance Method Summary collapse
-
#initialize(raise_error) ⇒ RecordBuilder
constructor
A new instance of RecordBuilder.
- #new_syntax ⇒ Object
- #old_syntax ⇒ Object
Methods inherited from RecordBuilder
Constructor Details
#initialize(raise_error) ⇒ RecordBuilder
Returns a new instance of RecordBuilder.
42 43 44 |
# File 'lib/transpec/syntax/raise_error.rb', line 42 def initialize(raise_error) @raise_error = raise_error end |
Instance Attribute Details
#raise_error ⇒ Object (readonly)
Returns the value of attribute raise_error.
40 41 42 |
# File 'lib/transpec/syntax/raise_error.rb', line 40 def raise_error @raise_error end |
Instance Method Details
#new_syntax ⇒ Object
59 60 61 |
# File 'lib/transpec/syntax/raise_error.rb', line 59 def new_syntax 'expect { }.not_to raise_error' end |
#old_syntax ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/transpec/syntax/raise_error.rb', line 46 def old_syntax syntax = 'expect { }.not_to raise_error(' if raise_error.specific_class? syntax << 'SpecificErrorClass' syntax << ', ' if raise_error. end syntax << 'message' if raise_error. syntax << ')' end |