rspec-nc 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  RSpec Notification Center
2
2
  =========================
3
3
 
4
+ [![Build Status](https://secure.travis-ci.org/twe4ked/rspec-nc.png?branch=master)](http://travis-ci.org/twe4ked/rspec-nc)
5
+ [![Dependency status](https://gemnasium.com/twe4ked/rspec-nc.png)](https://gemnasium.com/twe4ked/rspec-nc)
6
+
4
7
  rspec-nc is an RSpec formatter for Mountain Lion's Notification Center.
5
8
 
6
9
  ![Screenshot](http://twe4ked.github.com/rspec-nc/rspec-nc.jpg)
data/Rakefile CHANGED
@@ -1,2 +1,8 @@
1
1
  #!/usr/bin/env rake
2
- require "bundler/gem_tasks"
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task :default => :spec
data/lib/nc_fail.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'nc'
2
+
3
+ class NcFail < Nc
4
+ def say(title, body)
5
+ return if @failed_examples.size <= 0
6
+ super
7
+ end
8
+ end
data/rspec-nc.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  Gem::Specification.new do |gem|
3
3
  gem.name = 'rspec-nc'
4
- gem.version = '0.0.4'
4
+ gem.version = '0.0.5'
5
5
  gem.authors = ['Odin Dutton']
6
6
  gem.email = ['odindutton@gmail.com']
7
7
  gem.description = 'https://github.com/twe4ked/rspec-nc'
@@ -0,0 +1,18 @@
1
+ require 'nc_fail'
2
+
3
+ describe NcFail do
4
+ let(:formatter) { NcFail.new(StringIO.new) }
5
+
6
+ it 'returns a failing notification' do
7
+ TerminalNotifier.should_receive(:notify)
8
+
9
+ formatter.instance_variable_set('@failed_examples', [1])
10
+ formatter.say('title', 'body')
11
+ end
12
+
13
+ it 'does not return a success notification when tests are passing' do
14
+ TerminalNotifier.should_not_receive(:notify)
15
+
16
+ formatter.say('title', 'body')
17
+ end
18
+ end
data/spec/nc_spec.rb CHANGED
@@ -1,11 +1,5 @@
1
1
  require 'nc'
2
2
 
3
- RSpec.configure do |config|
4
- config.color_enabled = true
5
- config.formatter = 'doc'
6
- config.formatter = 'Nc'
7
- end
8
-
9
3
  describe Nc do
10
4
  let(:formatter) { Nc.new(StringIO.new) }
11
5
  let(:current_dir) { File.basename(File.expand_path '.') }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-nc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-24 00:00:00.000000000 Z
12
+ date: 2013-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: terminal-notifier
@@ -56,7 +56,9 @@ files:
56
56
  - README.md
57
57
  - Rakefile
58
58
  - lib/nc.rb
59
+ - lib/nc_fail.rb
59
60
  - rspec-nc.gemspec
61
+ - spec/nc_fail_spec.rb
60
62
  - spec/nc_spec.rb
61
63
  homepage: https://github.com/twe4ked/rspec-nc
62
64
  licenses: []
@@ -72,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
74
  version: '0'
73
75
  segments:
74
76
  - 0
75
- hash: -1642231777511652273
77
+ hash: -2829950422095626050
76
78
  required_rubygems_version: !ruby/object:Gem::Requirement
77
79
  none: false
78
80
  requirements:
@@ -81,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
83
  version: '0'
82
84
  segments:
83
85
  - 0
84
- hash: -1642231777511652273
86
+ hash: -2829950422095626050
85
87
  requirements: []
86
88
  rubyforge_project:
87
89
  rubygems_version: 1.8.23
@@ -89,4 +91,5 @@ signing_key:
89
91
  specification_version: 3
90
92
  summary: RSpec formatter for Mountain Lion's Notification Center
91
93
  test_files:
94
+ - spec/nc_fail_spec.rb
92
95
  - spec/nc_spec.rb