running_man 0.3.0 → 0.3.9

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
@@ -52,22 +52,6 @@ Rake::TestTask.new(:test) do |test|
52
52
  test.verbose = true
53
53
  end
54
54
 
55
- desc "Generate RCov test coverage and open in your browser"
56
- task :coverage do
57
- require 'rcov'
58
- sh "rm -fr coverage"
59
- sh "rcov test/test_*.rb"
60
- sh "open coverage/index.html"
61
- end
62
-
63
- require 'rake/rdoctask'
64
- Rake::RDocTask.new do |rdoc|
65
- rdoc.rdoc_dir = 'rdoc'
66
- rdoc.title = "#{name} #{version}"
67
- rdoc.rdoc_files.include('README*')
68
- rdoc.rdoc_files.include('lib/**/*.rb')
69
- end
70
-
71
55
  desc "Open an irb session preloaded with this library"
72
56
  task :console do
73
57
  sh "irb -rubygems -r ./lib/#{name}.rb"
@@ -143,4 +127,4 @@ task :validate do
143
127
  puts "A `VERSION` file at root level violates Gem best practices."
144
128
  exit!
145
129
  end
146
- end
130
+ end
@@ -66,7 +66,7 @@ module RunningMan
66
66
  end
67
67
 
68
68
  # This sets the instance variables set from #run_once on the test case.
69
- #
69
+ #
70
70
  # binding - The same Object that is given to #run.
71
71
  #
72
72
  # Returns nothing.
@@ -94,8 +94,7 @@ module RunningMan
94
94
  end
95
95
  end
96
96
 
97
- # TODO: Add MiniTest support for ruby 1.9
98
- if defined?(Test::Unit::TestSuite) && defined?(Test::Unit::TestCase)
97
+ if defined?(Test::Unit::TestCase)
99
98
  module Test
100
99
  module Unit
101
100
  class TestCase
@@ -103,7 +102,13 @@ if defined?(Test::Unit::TestSuite) && defined?(Test::Unit::TestCase)
103
102
  @final_teardowns ||= []
104
103
  end
105
104
  end
105
+ end
106
+ end
107
+ end
106
108
 
109
+ if defined?(Test::Unit::TestSuite)
110
+ module Test
111
+ module Unit
107
112
  class TestSuite
108
113
  def run(result, &progress_block) # :nodoc:
109
114
  yield(STARTED, name)
@@ -115,7 +120,12 @@ if defined?(Test::Unit::TestSuite) && defined?(Test::Unit::TestCase)
115
120
  end
116
121
  if klass_to_teardown
117
122
  klass_to_teardown.final_teardowns.each do |teardown|
118
- teardown.run(@tests.last)
123
+ begin
124
+ teardown.run(@tests.last)
125
+ rescue
126
+ puts "#{$!.class} on #{klass_to_teardown} teardown: #{$!}"
127
+ $!.backtrace { |b| puts ">> #{b}" }
128
+ end
119
129
  end
120
130
  end
121
131
  yield(FINISHED, name)
@@ -124,3 +134,24 @@ if defined?(Test::Unit::TestSuite) && defined?(Test::Unit::TestCase)
124
134
  end
125
135
  end
126
136
  end
137
+
138
+ if defined?(MiniTest::Unit)
139
+ module MiniTest
140
+ class Unit
141
+ def _run_suite_with_rm(suite, type)
142
+ ret = _run_suite_without_rm(suite, type)
143
+ suite.final_teardowns.each do |teardown|
144
+ begin
145
+ teardown.run(suite)
146
+ rescue
147
+ puts "#{$!.class} on #{suite} teardown: #{$!}"
148
+ $!.backtrace { |b| puts ">> #{b}" }
149
+ end
150
+ end if suite.respond_to?(:final_teardowns)
151
+ ret
152
+ end
153
+ alias _run_suite_without_rm _run_suite
154
+ alias _run_suite _run_suite_with_rm
155
+ end
156
+ end
157
+ end
data/lib/running_man.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
2
2
 
3
3
  module RunningMan
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.9'
5
5
 
6
6
  # Public: Sets up any helper class methods in TestClassMethods on the
7
7
  # specified test case class.
@@ -14,7 +14,7 @@ module RunningMan
14
14
  # # extends ActiveSupport::TestCase
15
15
  # RunningMan::Block.setup_on ActiveSupport::TestCase
16
16
  #
17
- # # extends test/unit with RunningMan::Block::TestClassMethods and
17
+ # # extends test/unit with RunningMan::Block::TestClassMethods and
18
18
  # # RunningMan::FooBlock::TestClassMethods
19
19
  # RunningMan::Block.setup_on Test::Unit::TestCase, :FooBlock
20
20
  #
@@ -24,7 +24,7 @@ module RunningMan
24
24
  #
25
25
  # source - The class to extend. Usually Test::Unit::TestCase.
26
26
  # *klasses - Optional Array of RunningMan::Block subclasses or Symbols.
27
- #
27
+ #
28
28
  # Returns nothing.
29
29
  def self.setup_on(source, *klasses)
30
30
  klasses.unshift(Block)
data/running_man.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 = 'running_man'
16
- s.version = '0.3.0'
17
- s.date = '2011-07-13'
16
+ s.version = '0.3.9'
17
+ s.date = '2012-05-23'
18
18
  s.rubyforge_project = 'running_man'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -31,4 +31,4 @@ class BlockHelperTest < Test::Unit::TestCase
31
31
  def test_again
32
32
  self.class.test_calls += 1
33
33
  end
34
- end
34
+ end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: running_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ hash: 1
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 3
9
+ - 9
10
+ version: 0.3.9
5
11
  platform: ruby
6
12
  authors:
7
13
  - rick
@@ -9,8 +15,7 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2011-07-13 00:00:00 -07:00
13
- default_executable:
18
+ date: 2012-05-23 00:00:00 Z
14
19
  dependencies: []
15
20
 
16
21
  description: Simple class for test/unit setup blocks that run just once.
@@ -33,7 +38,6 @@ files:
33
38
  - test/running_man/block_helper_test.rb
34
39
  - test/running_man/block_test.rb
35
40
  - test/test_helper.rb
36
- has_rdoc: true
37
41
  homepage: http://github.com/technoweenie/running_man
38
42
  licenses: []
39
43
 
@@ -43,21 +47,27 @@ rdoc_options: []
43
47
  require_paths:
44
48
  - lib
45
49
  required_ruby_version: !ruby/object:Gem::Requirement
50
+ none: false
46
51
  requirements:
47
52
  - - ">="
48
53
  - !ruby/object:Gem::Version
54
+ hash: 3
55
+ segments:
56
+ - 0
49
57
  version: "0"
50
- version:
51
58
  required_rubygems_version: !ruby/object:Gem::Requirement
59
+ none: false
52
60
  requirements:
53
61
  - - ">="
54
62
  - !ruby/object:Gem::Version
63
+ hash: 3
64
+ segments:
65
+ - 0
55
66
  version: "0"
56
- version:
57
67
  requirements: []
58
68
 
59
69
  rubyforge_project: running_man
60
- rubygems_version: 1.3.5
70
+ rubygems_version: 1.8.10
61
71
  signing_key:
62
72
  specification_version: 2
63
73
  summary: Simple class for test/unit setup blocks that run just once.