rscm 0.3.11 → 0.3.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/CHANGES +6 -0
  2. data/README +1 -1
  3. data/Rakefile +1 -1
  4. data/lib/rscm/mockit.rb +45 -18
  5. metadata +3 -5
data/CHANGES CHANGED
@@ -1,5 +1,11 @@
1
1
  = RSCM Changelog
2
2
 
3
+ == Version 0.3.12
4
+
5
+ Bugfix release
6
+
7
+ * Made Mockit setup/teardown work with other setup/teardown extensions
8
+
3
9
  == Version 0.3.11
4
10
 
5
11
  Cleanup release
data/README CHANGED
@@ -1,4 +1,4 @@
1
- = RSCM - Ruby Source Control Management (0.3.11)
1
+ = RSCM - Ruby Source Control Management (0.3.12)
2
2
 
3
3
  RSCM is to SCM what DBI/JDBC/ODBC are to databases - an SCM-independent API for accessing different SCMs. The high level features are roughly:
4
4
 
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ require 'meta_project'
10
10
 
11
11
  PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
12
12
  PKG_NAME = 'rscm'
13
- PKG_VERSION = '0.3.11' + PKG_BUILD
13
+ PKG_VERSION = '0.3.12' + PKG_BUILD
14
14
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
15
15
 
16
16
  desc "Default Task"
@@ -1,26 +1,53 @@
1
1
  require 'test/unit/assertions'
2
2
 
3
- module MockIt
4
-
5
- def setup
6
- @to_verify = []
7
- end
8
- module_function :setup
9
-
10
- def teardown
11
- super
12
- if(@test_passed && @to_verify)
13
- @to_verify.each{|m| m.__verify}
14
- end
15
- end
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
- def new_mock
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.11
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.11
7
- date: 2005-11-03 00:00:00 -05:00
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: