AutoZest 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ require "lib/autozest"
10
10
  # Constants
11
11
  ##############################################################################
12
12
  GemName = "AutoZest"
13
- Version = "0.0.1"
13
+ Version = AutoZest::Version
14
14
  Title = "Refreshing Taunts"
15
15
  Summary = "AutoZest < ZenTest::AutoTest extension for growl & custom messages"
16
16
  Authors = "Wayne E. Seguin, Lance Carlson"
@@ -11,5 +11,5 @@ require "#{File.dirname(__FILE__)}/autozest/generator"
11
11
  require "#{File.dirname(__FILE__)}/autozest/installer"
12
12
 
13
13
  module AutoZest
14
- Version = "0.0.1"
14
+ Version = "0.0.2"
15
15
  end
@@ -5,8 +5,10 @@ module AutoZest
5
5
  attr_accessor :examples, :failures, :pending
6
6
 
7
7
  # Sends the command to the console (Only supports Growl at the moment)
8
- def notify!(results)
9
- parse(results)
8
+ def notify!(autotest_results)
9
+
10
+ parse(autotest_results)
11
+
10
12
  # TODO: this should all come from config
11
13
  if AutoZest::Config[:notifier] == "gnome"
12
14
  # TODO: deal with it :-p
@@ -19,12 +21,12 @@ module AutoZest
19
21
  cmd << " -m '#{message}'"
20
22
  cmd << " --title #{title}" unless title.empty?
21
23
  end
22
- puts "<i> #{message}"
24
+ puts "AutoZest: <i> #{message}"
23
25
  system(cmd)
24
26
  end
25
27
 
26
28
  private
27
-
29
+
28
30
  # returns a message string based on the number of failures
29
31
  def message
30
32
  # for now we'll test with this
@@ -71,10 +73,14 @@ module AutoZest
71
73
  ""
72
74
  end
73
75
 
74
- def parse(results)
76
+ def parse(autotest_results)
77
+ results = [autotest_results].flatten.join
75
78
  # TODO: Verifiy that test / test::unit both spitout errors in the
76
79
  # same order as rspec. If not we have to adjust below slightly.
77
- @examples, @failures, @pending = results.scan(/(\d+)/).map{ |d| d.first.to_i }
80
+ #@examples, @failures, @pending = results.scan(/(\d+)/).map{ |d| d.first.to_i }
81
+ regex = /(\d+)\s+example(?:s)?,\s+(\d+)\s+failure(?:s)?,\s+(\d+)\s+pending/
82
+ match = results.scan(regex).first
83
+ @examples, @failures, @pending = match[0].to_i, match[1].to_i, match[2].to_i
78
84
  end
79
85
 
80
86
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: AutoZest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wayne E. Seguin
@@ -45,7 +45,7 @@ post_install_message:
45
45
  rdoc_options:
46
46
  - --quiet
47
47
  - --title
48
- - AutoZest-0.0.1 Reference
48
+ - AutoZest-0.0.2 Reference
49
49
  - --main
50
50
  - README
51
51
  - --inline-source