Class: EqJsonDebugDumper
- Inherits:
-
Object
- Object
- EqJsonDebugDumper
- Defined in:
- lib/debug_dumper.rb
Instance Method Summary collapse
- #dump ⇒ Object
- #dumpToFile(baseName, jsonHash) ⇒ Object
-
#initialize(matcher) ⇒ EqJsonDebugDumper
constructor
A new instance of EqJsonDebugDumper.
Constructor Details
#initialize(matcher) ⇒ EqJsonDebugDumper
Returns a new instance of EqJsonDebugDumper.
5 6 7 |
# File 'lib/debug_dumper.rb', line 5 def initialize(matcher) @matcher = matcher end |
Instance Method Details
#dump ⇒ Object
9 10 11 12 13 14 |
# File 'lib/debug_dumper.rb', line 9 def dump dumpToFile('expected', @matcher.expected) dumpToFile('actual', @matcher.actual) dumpToFile('currentExpectedObj', @matcher.currentExpectedObj) dumpToFile('currentActualObj', @matcher.currentActualObj) end |
#dumpToFile(baseName, jsonHash) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/debug_dumper.rb', line 16 def dumpToFile(baseName, jsonHash) fileName = Dir.tmpdir() + File::SEPARATOR + "#{baseName}.json" File.open(fileName, "w") do |file| file.print JSON.pretty_generate(jsonHash) end end |