test_startup 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/test_startup.rb CHANGED
@@ -29,9 +29,9 @@ module TestStartupAndShutdown
29
29
  mysuite.instance_eval { @__startup_blocks = these_startup_blocks }
30
30
  mysuite.instance_eval { @__shutdown_blocks = these_shutdown_blocks }
31
31
  def mysuite.run(*args)
32
- @__startup_blocks.each { |block| block.call }
32
+ (@__startup_blocks || []).each { |block| block.call }
33
33
  super
34
- @__shutdown_blocks.each { |block| block.call }
34
+ (@__shutdown_blocks || []).each { |block| block.call }
35
35
  end
36
36
  mysuite
37
37
  end
@@ -36,12 +36,20 @@ class TestStartupExternalTest < Test::Unit::TestCase
36
36
  end
37
37
  end
38
38
 
39
+ class TestStartupWithoutShutdown < Test::Unit::TestCase
40
+ startup { 1 + 1 }
41
+ def test_should_not_fail_without_a_shutdown_block
42
+ assert true # this testcase will explode to demonstrate failure
43
+ end
44
+ end
45
+
39
46
  class TestStartupSuite < Test::Unit::TestSuite
40
47
  # taking advantage of the fact that the tests run in the order they're added here.
41
48
  def self.suite
42
49
  result = self.new(self.class.name)
43
50
  result << TestStartupTest.suite
44
51
  result << TestStartupExternalTest.suite
52
+ result << TestStartupWithoutShutdown.suite
45
53
  return result
46
54
  end
47
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_startup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Adam
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-23 00:00:00 +01:00
12
+ date: 2010-02-01 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -50,7 +50,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  requirements: []
51
51
 
52
52
  rubyforge_project: test_startup
53
- rubygems_version: 1.3.3
53
+ rubygems_version: 1.3.5
54
54
  signing_key:
55
55
  specification_version: 3
56
56
  summary: Adds Ruby 1.9-style startup and shutdown mechanisms to test/unit (or shoulda)