scope 0.2.2 → 0.2.3

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.
Files changed (3) hide show
  1. data/lib/scope.rb +12 -2
  2. data/scope.gemspec +1 -1
  3. metadata +5 -7
@@ -89,8 +89,18 @@ module Scope
89
89
  context = self.class.context_for_test[test_name]
90
90
  result = nil
91
91
  begin
92
- # Unit::TestCase's implementation of run() invokes the test method with exception handling.
93
- context.run_setup_and_teardown(self, test_name) { result = super(test_runner) }
92
+ begin
93
+ # Prevent super from calling the minitest setup after the Scope setup blocks have already run. The
94
+ # motivation is that RR puts hooks into setup to reset stubs and mocks and this needs to happen
95
+ # *before* the test setup occurs.
96
+ self.setup
97
+ old_setup = self.method(:setup)
98
+ def self.setup; end
99
+ # Unit::TestCase's implementation of run() invokes the test method with exception handling.
100
+ context.run_setup_and_teardown(self, test_name) { result = super(test_runner) }
101
+ ensure
102
+ def self.setup; old_setup; end
103
+ end
94
104
  rescue *MiniTest::Unit::TestCase::PASSTHROUGH_EXCEPTIONS
95
105
  raise
96
106
  rescue Exception => error
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "scope"
3
- s.version = "0.2.2"
3
+ s.version = "0.2.3"
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=
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scope
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Phil Crosby
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-27 00:00:00 -07:00
19
- default_executable:
18
+ date: 2011-08-19 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: minitest
@@ -43,7 +42,6 @@ extra_rdoc_files: []
43
42
  files:
44
43
  - scope.gemspec
45
44
  - lib/scope.rb
46
- has_rdoc: true
47
45
  homepage: http://github.com/ooyala/scope
48
46
  licenses: []
49
47
 
@@ -73,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
71
  requirements: []
74
72
 
75
73
  rubyforge_project: scope
76
- rubygems_version: 1.6.2
74
+ rubygems_version: 1.8.5
77
75
  signing_key:
78
76
  specification_version: 2
79
77
  summary: Concise unit testing in the spirit of Shoulda