Class: ApprovalTests::Writers::HtmlWriter
- Inherits:
-
Object
- Object
- ApprovalTests::Writers::HtmlWriter
- Defined in:
- lib/approval_tests/writers/html_writer.rb
Instance Method Summary collapse
- #get_approval_filename(basename) ⇒ Object
- #get_received_filename(basename) ⇒ Object
-
#initialize(data) ⇒ HtmlWriter
constructor
A new instance of HtmlWriter.
- #write_received_file(received) ⇒ Object
Constructor Details
#initialize(data) ⇒ HtmlWriter
Returns a new instance of HtmlWriter.
4 5 6 |
# File 'lib/approval_tests/writers/html_writer.rb', line 4 def initialize(data) @data = data end |
Instance Method Details
#get_approval_filename(basename) ⇒ Object
8 9 10 |
# File 'lib/approval_tests/writers/html_writer.rb', line 8 def get_approval_filename(basename) basename + ".approved.html" end |
#get_received_filename(basename) ⇒ Object
12 13 14 |
# File 'lib/approval_tests/writers/html_writer.rb', line 12 def get_received_filename(basename) basename + ".received.html" end |
#write_received_file(received) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/approval_tests/writers/html_writer.rb', line 16 def write_received_file(received) f = File.new("#{received}", "w+") f.write(@data) f.close() f.path end |