Skip to content

Commit

Permalink
Now supported "Autotest::Rspec2" and "Autotest::RailsRspec2".
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/autotest-screen/dev/": change = 6476]
  • Loading branch information
yoshuki committed Jul 22, 2011
1 parent f11a086 commit 81bf2a2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
6 changes: 6 additions & 0 deletions History.txt
@@ -1,3 +1,9 @@
=== 4.0.3 / 2011-07-23

* 1 minor enhancement:

* Supported "Autotest::Rspec2" and "Autotest::RailsRspec2".

=== 4.0.2 / 2009-10-30

* 1 minor enhancement:
Expand Down
30 changes: 15 additions & 15 deletions lib/autotest/screen.rb
Expand Up @@ -2,7 +2,7 @@
require 'autotest'

##
# Autotest::Screen shows autotest/autospec progress on GNU Screen's status line.
# Autotest::Screen displays autotest/autospec progress on GNU Screen's status line.
#
# == FEATURES:
# * Screenshots are available in here[http://f.hatena.ne.jp/yoshuki/autotest_screen/].
Expand All @@ -14,7 +14,7 @@
#

class Autotest::Screen
VERSION = '4.0.2'
VERSION = '4.0.3'

DEFAULT_STATUSLINE = '%H %`%-w%{=b bw}%n %t%{-}%+w'
DEFAULT_SCREEN_CMD = 'screen'
Expand Down Expand Up @@ -62,36 +62,36 @@ def self.send_cmd(msg)
# All blocks return false, to execute each of following blocks defined in user's own ".autotest".

# Do nothing.
#Autotest.add_hook :all_good do |at|
#Autotest.add_hook :all_good do |at, *args|
# next false
#end

Autotest.add_hook :died do |at|
Autotest.add_hook :died do |at, *args|
message "Exception occured. (#{at.class})", :red
next false
end

# Do nothing.
#Autotest.add_hook :green do |at|
#Autotest.add_hook :green do |at, *args|
# next false
#end

Autotest.add_hook :initialize do |at|
Autotest.add_hook :initialize do |at, *args|
message "Run with #{at.class}" if execute?
next false
end

# Do nothing.
#Autotest.add_hook :interrupt do |at|
#Autotest.add_hook :interrupt do |at, *args|
# next false
#end

Autotest.add_hook :quit do |at|
Autotest.add_hook :quit do |at, *args|
clear if execute?
next false
end

Autotest.add_hook :ran_command do |at|
Autotest.add_hook :ran_command do |at, *args|
next false unless execute?

output = at.results.join
Expand All @@ -106,7 +106,7 @@ def self.send_cmd(msg)
else
@last_message = {:message => 'All Green', :color => :green}
end
when 'Autotest::Rspec', 'Autotest::RailsRspec', 'Autotest::MerbRspec'
when 'Autotest::Rspec', 'Autotest::Rspec2', 'Autotest::RailsRspec', 'Autotest::RailsRspec2', 'Autotest::MerbRspec'
results = output.scan(/(\d+)\s*examples?,\s*(\d+)\s*failures?(?:,\s*(\d+)\s*pendings?)?/).first
num_examples, num_failures, num_pendings = results.map{|r| r.to_i}

Expand All @@ -122,26 +122,26 @@ def self.send_cmd(msg)
end

# Do nothing.
#Autotest.add_hook :red do |at|
#Autotest.add_hook :red do |at, *args|
# next false
#end

# Do nothing.
#Autotest.add_hook :reset do |at|
#Autotest.add_hook :reset do |at, *args|
# next false
#end

Autotest.add_hook :run_command do |at|
Autotest.add_hook :run_command do |at, *args|
message 'Running' if execute?
next false
end

# Do nothing.
#Autotest.add_hook :updated do |at, updated|
#Autotest.add_hook :updated do |at, *args|
# next false
#end

Autotest.add_hook :waiting do |at|
Autotest.add_hook :waiting do |at, *args|
message @last_message[:message], @last_message[:color] if execute?
next false
end
Expand Down

0 comments on commit 81bf2a2

Please sign in to comment.