rscm 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/README +1 -1
- data/Rakefile +1 -1
- data/lib/rscm/mockit.rb +45 -18
- metadata +3 -5
data/CHANGES
CHANGED
data/README
CHANGED
data/Rakefile
CHANGED
data/lib/rscm/mockit.rb
CHANGED
@@ -1,26 +1,53 @@
|
|
1
1
|
require 'test/unit/assertions'
|
2
2
|
|
3
|
-
module
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
module Test #:nodoc:
|
4
|
+
module Unit #:nodoc:
|
5
|
+
class TestCase #:nodoc:
|
6
|
+
def setup_with_mocks
|
7
|
+
@to_verify = []
|
8
|
+
end
|
9
|
+
alias_method :setup, :setup_with_mocks
|
10
|
+
|
11
|
+
def teardown_with_mocks
|
12
|
+
if(@test_passed && @to_verify)
|
13
|
+
@to_verify.each{|m| m.__verify}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
alias_method :teardown, :teardown_with_mocks
|
17
|
+
|
18
|
+
def self.method_added(method)
|
19
|
+
case method.to_s
|
20
|
+
when 'setup'
|
21
|
+
unless method_defined?(:setup_without_mocks)
|
22
|
+
alias_method :setup_without_mocks, :setup
|
23
|
+
define_method(:setup) do
|
24
|
+
setup_with_mocks
|
25
|
+
setup_without_mocks
|
26
|
+
end
|
27
|
+
end
|
28
|
+
when 'teardown'
|
29
|
+
unless method_defined?(:teardown_without_mocks)
|
30
|
+
alias_method :teardown_without_mocks, :teardown
|
31
|
+
define_method(:teardown) do
|
32
|
+
teardown_without_mocks
|
33
|
+
teardown_with_mocks
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def new_mock
|
40
|
+
mock = MockIt::Mock.new
|
41
|
+
@to_verify = [] unless @to_verify
|
42
|
+
@to_verify << mock
|
43
|
+
mock
|
44
|
+
end
|
16
45
|
|
17
|
-
|
18
|
-
mock = MockIt::Mock.new
|
19
|
-
@to_verify = [] unless @to_verify
|
20
|
-
@to_verify << mock
|
21
|
-
mock
|
46
|
+
end
|
22
47
|
end
|
48
|
+
end
|
23
49
|
|
50
|
+
module MockIt
|
24
51
|
class Mock
|
25
52
|
include Test::Unit::Assertions
|
26
53
|
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.8.
|
2
|
+
rubygems_version: 0.8.10
|
3
3
|
specification_version: 1
|
4
4
|
name: rscm
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.3.
|
7
|
-
date: 2005-11-
|
6
|
+
version: 0.3.12
|
7
|
+
date: 2005-11-09
|
8
8
|
summary: "RSCM - Ruby Source Control Management"
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -24,8 +24,6 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
24
24
|
version: 0.0.0
|
25
25
|
version:
|
26
26
|
platform: ruby
|
27
|
-
signing_key:
|
28
|
-
cert_chain:
|
29
27
|
authors:
|
30
28
|
- Aslak Hellesoy
|
31
29
|
files:
|