Class: ApprovalTests::Reporters::TextMateReporter

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/approval_tests/reporters/text_mate_reporter.rb

Instance Method Summary collapse

Instance Method Details

#approved_when_reportedObject



19
20
21
# File 'lib/approval_tests/reporters/text_mate_reporter.rb', line 19

def approved_when_reported
  false 
end

#report(approved, received) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/approval_tests/reporters/text_mate_reporter.rb', line 8

def report(approved, received)
  puts "<script language='JavaScript'>
        function move(received, approved) {
          return TextMate.system('mv ' + received + ' ' + approved, null).outputString;
        }
        </script>"    
  puts "<a href='#' onclick='move(\"#{File.expand_path(received)}\",\"#{File.expand_path(approved)}\")'>Approve</a>"
  puts "<a href='txmt://open?url=file://#{File.expand_path(received)}'>View</a>"
  puts "<p></p><iframe src='tm-file://#{File.expand_path(received)}' width='100%' frameborder='0' style='border:solid 1px red'></iframe>"
end