shindo 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -45,7 +45,7 @@ end
45
45
 
46
46
  require File.join(File.dirname(__FILE__), 'lib', 'shindo', 'rake')
47
47
  Shindo::Rake.new
48
- task :default => :tests
48
+ task :default => :shindo_tests
49
49
 
50
50
  desc "Generate RCov test coverage and open in your browser"
51
51
  task :coverage do
@@ -140,3 +140,12 @@ task :validate do
140
140
  exit!
141
141
  end
142
142
  end
143
+
144
+ task :shindo_tests do
145
+ system "shindo -build_error"
146
+ fail "Tests excluding build error should pass" unless $? == 0
147
+
148
+ puts "2"
149
+ system "shindo +build_error"
150
+ fail "The build_error test should fail" unless $? != 0
151
+ end
data/lib/shindo.rb CHANGED
@@ -5,7 +5,7 @@ module Shindo
5
5
  class Pending < StandardError; end
6
6
 
7
7
  unless const_defined?(:VERSION)
8
- VERSION = '0.3.6'
8
+ VERSION = '0.3.7'
9
9
  end
10
10
 
11
11
  def self.tests(description = nil, tags = [], &block)
@@ -81,6 +81,7 @@ module Shindo
81
81
  display_pending(description)
82
82
  rescue => error
83
83
  display_error(error)
84
+ abort "An error occurred outside of a test"
84
85
  ensure
85
86
  # HACK: decrease indent
86
87
  indent = Thread.current[:formatador].instance_variable_get(:@indent)
data/lib/shindo/bin.rb CHANGED
@@ -62,7 +62,12 @@ def run_in_thread(helpers, tests, thread_locals)
62
62
  end
63
63
  end
64
64
  }
65
- shindo.join
65
+ begin
66
+ shindo.join
67
+ rescue
68
+ # continue, even if threads are gone
69
+ # see: https://github.com/geemus/shindo/issues/12
70
+ end
66
71
  if shindo[:reload]
67
72
  run_in_thread(helpers, tests, thread_locals)
68
73
  else
data/lib/shindo/rake.rb CHANGED
@@ -8,6 +8,7 @@ module Shindo
8
8
  desc "Run shindo tests"
9
9
  task :tests do
10
10
  system 'shindo'
11
+ fail if $? != 0
11
12
  end
12
13
  end
13
14
 
data/shindo.gemspec CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'shindo'
16
- s.version = '0.3.6'
17
- s.date = '2013-06-18'
16
+ s.version = '0.3.7'
17
+ s.date = '2013-10-09'
18
18
  s.rubyforge_project = 'shindo'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -72,6 +72,7 @@ Gem::Specification.new do |s|
72
72
  shindo.gemspec
73
73
  tests/basic_tests.rb
74
74
  tests/bin_tests.rb
75
+ tests/build_error_tests.rb
75
76
  tests/data/exception
76
77
  tests/data/failure
77
78
  tests/data/negative
@@ -0,0 +1,20 @@
1
+ def given_something
2
+ raise 'ERROR!'
3
+ end
4
+
5
+ Shindo.tests('Shindo build errors', ['build_error']) do
6
+ tests('another').returns(true) do
7
+ true
8
+ end
9
+
10
+ begin
11
+ given_something do
12
+ tests('success').returns(true) do
13
+ false
14
+ end
15
+ end
16
+ rescue
17
+ # an error occured above, but we intended it
18
+ end
19
+ end
20
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shindo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
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: 2013-06-18 00:00:00.000000000 Z
12
+ date: 2013-10-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: formatador
@@ -49,6 +49,7 @@ files:
49
49
  - shindo.gemspec
50
50
  - tests/basic_tests.rb
51
51
  - tests/bin_tests.rb
52
+ - tests/build_error_tests.rb
52
53
  - tests/data/exception
53
54
  - tests/data/failure
54
55
  - tests/data/negative