lib/autotest/notify-osd.rb in autotest-notify-osd-0.1.0 vs lib/autotest/notify-osd.rb in autotest-notify-osd-0.2.0

- old
+ new

@@ -77,90 +77,31 @@ end ## # Display the modified files. Autotest.add_hook :updated do |autotest, modified| - @ran_tests = @ran_features = false - if @@show_modified_files - if modified != @last_modified - notify_osd @label + 'Modifications detected.', modified.collect {|m| m[0]}.join(', '), 'info', 0 - @last_modified = modified - end - end + print "\nThis gem has been deprecated and replaced by autotest-growl\n" false end ## # Set the label and clear the terminal. Autotest.add_hook :run_command do - @label = File.basename(Dir.pwd).upcase + ': ' if !@@hide_label - print "\n"*2 + '-'*80 + "\n"*2 - system %(clear) if @@clear_terminal + print "\nThis gem has been deprecated and replaced by autotest-growl\n" false end ## # Parse the RSpec and Test::Unit results and send them to Growl. Autotest.add_hook :ran_command do |autotest| - unless @@one_notification_per_run && @ran_tests - result = Result.new(autotest) - if result.exists? - case result.framework - when 'test-unit' - if result.has?('test-error') - notify_osd @label + 'Cannot run some unit tests.', "#{result.get('test-error')} in #{result.get('test')}", 'error', 2 - elsif result.has?('test-failed') - notify_osd @label + 'Some unit tests failed.', "#{result['test-failed']} of #{result.get('test-assertion')} in #{result.get('test')} failed", 'failed', 2 - else - notify_osd @label + 'All unit tests passed.', "#{result.get('test-assertion')} in #{result.get('test')}", 'passed', -2 - end - when 'rspec' - if result.has?('example-failed') - notify_osd @label + 'Some RSpec examples failed.', "#{result['example-failed']} of #{result.get('example')} failed", 'failed', 2 - elsif result.has?('example-pending') - notify_osd @label + 'Some RSpec examples are pending.', "#{result['example-pending']} of #{result.get('example')} pending", 'pending', -1 - else - notify_osd @label + 'All RSpec examples passed.', "#{result.get('example')}", 'passed', -2 - end - end - else - notify_osd @label + 'Could not run tests.', '', 'error', 2 - end - @ran_test = true - end + print "\nThis gem has been deprecated and replaced by autotest-growl\n" false end ## # Parse the Cucumber results and sent them to Growl. Autotest.add_hook :ran_features do |autotest| - unless @@one_notification_per_run && @ran_features - result = Result.new(autotest) - if result.exists? - case result.framework - when 'cucumber' - explanation = [] - if result.has?('scenario-undefined') || result.has?('step-undefined') - explanation << "#{result['scenario-undefined']} of #{result.get('scenario')} not defined" if result['scenario-undefined'] - explanation << "#{result['step-undefined']} of #{result.get('step')} not defined" if result['step-undefined'] - notify_osd @label + 'Some Cucumber scenarios are not defined.', "#{explanation.join("\n")}", 'pending', -1 - elsif result.has?('scenario-failed') || result.has?('step-failed') - explanation << "#{result['scenario-failed']} of #{result.get('scenario')} failed" if result['scenario-failed'] - explanation << "#{result['step-failed']} of #{result.get('step')} failed" if result['step-failed'] - notify_osd @label + 'Some Cucumber scenarios failed.', "#{explanation.join("\n")}", 'failed', 2 - elsif result.has?('scenario-pending') || result.has?('step-pending') - explanation << "#{result['scenario-pending']} of #{result.get('scenario')} pending" if result['scenario-pending'] - explanation << "#{result['step-pending']} of #{result.get('step')} pending" if result['step-pending'] - notify_osd @label + 'Some Cucumber scenarios are pending.', "#{explanation.join("\n")}", 'pending', -1 - else - notify_osd @label + 'All Cucumber features passed.', '', 'passed', -2 - end - end - else - notify_osd @label + 'Could not run features.', '', 'error', 2 - end - @ran_features = true - end + print "\nThis gem has been deprecated and replaced by autotest-growl\n" false end end