scope 0.2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/scope.rb +9 -3
  2. data/scope.gemspec +2 -2
  3. metadata +3 -2
data/lib/scope.rb CHANGED
@@ -47,7 +47,7 @@ module Scope
47
47
  @focus_next_test = false
48
48
  end
49
49
 
50
- context_name = @contexts[1..-1].map(&:name).join(" ")
50
+ context_name = @contexts[1..-1].map { |context| context.name }.join(" ")
51
51
  context_name += " " unless context_name.empty?
52
52
  test_method_name = "#{context_name}should #{name}"
53
53
  define_method test_method_name, block
@@ -79,8 +79,14 @@ module Scope
79
79
  test_name = self.__name__
80
80
  context = self.class.context_for_test[test_name]
81
81
  result = nil
82
- # Unit::TestCase's implementation of run() invokes the test method (test_name) with exception handling.
83
- context.run_setup_and_teardown(self, test_name) { result = super }
82
+ begin
83
+ # Unit::TestCase's implementation of run() invokes the test method with exception handling.
84
+ context.run_setup_and_teardown(self, test_name) { result = super }
85
+ rescue *MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS
86
+ raise
87
+ rescue Exception => error
88
+ result = test_runner.puke(self.class, self.__name__, error)
89
+ end
84
90
  result
85
91
  end
86
92
  end
data/scope.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "scope"
3
- s.version = "0.2"
3
+ s.version = "0.2.1"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">=0") if s.respond_to? :required_rubygems_version=
6
6
  s.specification_version = 2 if s.respond_to? :specification_version=
@@ -18,4 +18,4 @@ Gem::Specification.new do |s|
18
18
  lib/scope.rb
19
19
  )
20
20
  s.add_dependency("minitest")
21
- end
21
+ end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scope
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- version: "0.2"
9
+ - 1
10
+ version: 0.2.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Phil Crosby