Module: SymTblGsub::Assertions
- Defined in:
- lib/sym_tbl_gsub.rb
Instance Attribute Summary collapse
-
#symtbl ⇒ Object
Returns the value of attribute symtbl.
Instance Method Summary collapse
- #assert_symtbl(my, ref) ⇒ Object
- #assert_symtbl!(my, ref) ⇒ Object
- #assert_symtbl_nil(my) ⇒ Object
- #assert_symtbl_nil!(my) ⇒ Object
Instance Attribute Details
#symtbl ⇒ Object
Returns the value of attribute symtbl.
10 11 12 |
# File 'lib/sym_tbl_gsub.rb', line 10 def symtbl @symtbl end |
Instance Method Details
#assert_symtbl(my, ref) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/sym_tbl_gsub.rb', line 12 def assert_symtbl ( my, ref ) my_copy = Marshal.load(Marshal.dump(my)) assert_equal ref, my.do_symtbl_gsub(symtbl) assert_equal my, my_copy, 'substitution not inplace has changed the object' end |
#assert_symtbl!(my, ref) ⇒ Object
23 24 25 |
# File 'lib/sym_tbl_gsub.rb', line 23 def assert_symtbl! ( my, ref ) assert_equal ref, my.do_symtbl_gsub!(symtbl) end |
#assert_symtbl_nil(my) ⇒ Object
19 20 21 |
# File 'lib/sym_tbl_gsub.rb', line 19 def assert_symtbl_nil ( my ) assert_nil my.symtbl_gsub(symtbl) end |
#assert_symtbl_nil!(my) ⇒ Object
27 28 29 |
# File 'lib/sym_tbl_gsub.rb', line 27 def assert_symtbl_nil! ( my ) assert_nil my.symtbl_gsub!(symtbl) end |