test_notifier 0.3.5.rc.1 → 0.3.5.rc.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ *.gem
2
+ pkg
3
+ nbproject
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler"
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require "rake/testtask"
5
+ Rake::TestTask.new do |t|
6
+ t.libs += %w[test lib]
7
+ t.ruby_opts = %w[-rubygems]
8
+ t.test_files = FileList["test/**/*_test.rb"]
9
+ t.verbose = true
10
+ end
@@ -4,7 +4,7 @@ module TestNotifier
4
4
  extend self
5
5
 
6
6
  def supported?
7
- RUBY_PLATFORM =~ /(linux|freebsd)/ && `which kdialog &> /dev/null` && $?.exitstatus == 0
7
+ RUBY_PLATFORM =~ /(linux|freebsd)/ && `which kdialog > /dev/null` && $? == 0
8
8
  end
9
9
 
10
10
  def notify(options)
@@ -4,7 +4,7 @@ module TestNotifier
4
4
  extend self
5
5
 
6
6
  def supported?
7
- RUBY_PLATFORM =~ /(linux|freebsd)/ && `which notify-send &> /dev/null` && $?.exitstatus == 0
7
+ RUBY_PLATFORM =~ /(linux|freebsd)/ && `which notify-send > /dev/null` && $? == 0
8
8
  end
9
9
 
10
10
  def notify(options)
@@ -14,7 +14,7 @@ module TestNotifier
14
14
  }
15
15
 
16
16
  def supported?
17
- RUBY_PLATFORM =~ /(linux|freebsd)/ && `which osd_cat &> /dev/null` && $?.exitstatus == 0
17
+ RUBY_PLATFORM =~ /(linux|freebsd)/ && `which osd_cat > /dev/null` && $? == 0
18
18
  end
19
19
 
20
20
  def notify(options)
@@ -7,7 +7,7 @@ module TestNotifier
7
7
  return false unless RUBY_PLATFORM =~ /(mswin|mingw)/
8
8
 
9
9
  begin
10
- require "snarl" unless defined?(Snarl)
10
+ require "snarl" unless defined?(::Snarl)
11
11
  true
12
12
  rescue LoadError
13
13
  false
@@ -15,7 +15,7 @@ module TestNotifier
15
15
  end
16
16
 
17
17
  def notify(options)
18
- Snarl.show_message(options[:title], options[:message], options[:image])
18
+ ::Snarl.show_message(options[:title], options[:message], options[:image])
19
19
  end
20
20
  end
21
21
  end
@@ -12,8 +12,8 @@ module TestNotifier
12
12
 
13
13
  def notifiers
14
14
  constants.collect do |name|
15
- const_get(name)
16
- end
15
+ const_get(name) unless name.to_s == "Placebo"
16
+ end.compact + [Placebo]
17
17
  end
18
18
 
19
19
  def supported_notifiers
@@ -29,6 +29,8 @@ Autotest.add_hook :ran_command do |at|
29
29
 
30
30
  TestNotifier.notify(:status => stats.status, :message => stats.message) unless tests.to_i.zero?
31
31
  end
32
- rescue
32
+ rescue => e
33
+ puts e
34
+ puts e.backtrace
33
35
  end
34
36
  end
@@ -21,7 +21,9 @@ class Test::Unit::UI::Console::TestRunner
21
21
  })
22
22
 
23
23
  TestNotifier.notify(:status => stats.status, :message => stats.message)
24
- rescue
24
+ rescue => e
25
+ puts e
26
+ puts e.backtrace
25
27
  end
26
28
  end
27
29
  end
@@ -16,6 +16,10 @@ class TestNotifier::NotifierTest < Test::Unit::TestCase
16
16
  assert_equal 7, TestNotifier::Notifier.notifiers.size
17
17
  end
18
18
 
19
+ test "consider Placebo as fallback notifier" do
20
+ assert_equal TestNotifier::Notifier::Placebo, TestNotifier::Notifier.notifiers.last
21
+ end
22
+
19
23
  test "return notifier by its name" do
20
24
  assert_equal TestNotifier::Notifier::OsdCat, TestNotifier::Notifier.from_name(:osd_cat)
21
25
  assert_equal TestNotifier::Notifier::NotifySend, TestNotifier::Notifier.from_name(:notify_send)
@@ -0,0 +1,28 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "test_notifier/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "test_notifier"
7
+ s.version = "#{TestNotifier::Version::STRING}.rc.2"
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Nando Vieira"]
10
+ s.email = ["fnando.vieira@gmail.com"]
11
+ s.homepage = "http://rubygems.org/gems/test_notifier"
12
+ s.summary = "Display system notifications (dbus, growl and snarl) after running tests."
13
+ s.description = <<-DESC
14
+ Display system notifications (dbus, growl and snarl) after
15
+ running tests. It works on Mac OS X, Linux and Windows. Powerful when used
16
+ with Autotest ZenTest gem for Rails apps.
17
+ DESC
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ["lib"]
23
+
24
+ s.requirements << "You'll need Growl (Mac OS X), Libnotify, OSD or KDE (Linux) or Snarl (Windows)"
25
+
26
+ s.add_development_dependency "test-unit"
27
+ s.add_development_dependency "mocha"
28
+ end
metadata CHANGED
@@ -7,8 +7,8 @@ version: !ruby/object:Gem::Version
7
7
  - 3
8
8
  - 5
9
9
  - rc
10
- - 1
11
- version: 0.3.5.rc.1
10
+ - 2
11
+ version: 0.3.5.rc.2
12
12
  platform: ruby
13
13
  authors:
14
14
  - Nando Vieira
@@ -16,20 +16,52 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-10-28 00:00:00 -02:00
19
+ date: 2010-11-12 00:00:00 -02:00
20
20
  default_executable:
21
- dependencies: []
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ name: test-unit
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :development
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: mocha
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ segments:
44
+ - 0
45
+ version: "0"
46
+ type: :development
47
+ version_requirements: *id002
48
+ description: |
49
+ Display system notifications (dbus, growl and snarl) after
50
+ running tests. It works on Mac OS X, Linux and Windows. Powerful when used
51
+ with Autotest ZenTest gem for Rails apps.
22
52
 
23
- description: " Display system notifications (dbus, growl and snarl) after\n running tests. It works on Mac OS X, Linux and Windows. Powerful when used\n with Autotest ZenTest gem for Rails apps.\n"
24
- email: fnando.vieira@gmail.com
53
+ email:
54
+ - fnando.vieira@gmail.com
25
55
  executables: []
26
56
 
27
57
  extensions: []
28
58
 
29
- extra_rdoc_files:
30
- - README.rdoc
59
+ extra_rdoc_files: []
60
+
31
61
  files:
62
+ - .gitignore
32
63
  - README.rdoc
64
+ - Rakefile
33
65
  - lib/test_notifier.rb
34
66
  - lib/test_notifier/autotest.rb
35
67
  - lib/test_notifier/notifier.rb
@@ -57,13 +89,14 @@ files:
57
89
  - test/stats_test.rb
58
90
  - test/test_helper.rb
59
91
  - test/test_notifier_test.rb
92
+ - test_notifier.gemspec
60
93
  has_rdoc: true
61
- homepage: http://github.com/fnando/test_notifier
94
+ homepage: http://rubygems.org/gems/test_notifier
62
95
  licenses: []
63
96
 
64
97
  post_install_message:
65
- rdoc_options:
66
- - --charset=UTF-8
98
+ rdoc_options: []
99
+
67
100
  require_paths:
68
101
  - lib
69
102
  required_ruby_version: !ruby/object:Gem::Requirement