greenbar 0.1.1

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.
@@ -0,0 +1,45 @@
1
+ # Copyright 2005, 2006 Enttek, Inc, All Rights Reserved
2
+ # Copyright 2005, 2006 Kiel Hodges, All Rights Reserved
3
+ # Copyright 2005, 2006 David Corbin <dcorbin@users.sourceforge.net>, All Rights Reserved
4
+ #
5
+ # This software may be copied and used only in accordance with the
6
+ # terms provided in the include LICENSE file. If no such file is included
7
+ # then please contact the authors of the Greenbar project at
8
+ # http://rubyforge.org/projects/greenbar/
9
+ #
10
+ require 'test/unit'
11
+ require 'greenbar'
12
+
13
+ class TimeSetupTest < Test::Unit::TestCase
14
+
15
+ class Test
16
+ include Greenbar::TimeSetup
17
+ end
18
+
19
+ def test_time_mixin
20
+ july4th2004 = Time.utc 2004, 7, 4, 14, 30, 0
21
+
22
+ test = Test.new
23
+ test.setup
24
+
25
+ assert_raise(RuntimeError, 'Expected a RuntimeError if Time.now= not called before Time.now') {
26
+ Time.now
27
+ }
28
+
29
+ assert_raise(RuntimeError, 'Expected a RuntimeError if Time.now= not called before Time.new') {
30
+ Time.new
31
+ }
32
+
33
+ Time.now = july4th2004
34
+ assert_equal july4th2004, Time.now
35
+ assert_equal july4th2004, Time.new
36
+
37
+ test.teardown
38
+ assert Time.new > july4th2004
39
+ assert Time.now > july4th2004
40
+ assert_raise(NoMethodError) {
41
+ Time.now = july4th2004
42
+ }
43
+ end
44
+
45
+ end
@@ -0,0 +1,17 @@
1
+ # Copyright 2005, 2006 Enttek, Inc, All Rights Reserved
2
+ # Copyright 2005, 2006 Kiel Hodges, All Rights Reserved
3
+ # Copyright 2005, 2006 David Corbin <dcorbin@users.sourceforge.net>, All Rights Reserved
4
+ #
5
+ # This software may be copied and used only in accordance with the
6
+ # terms provided in the include LICENSE file. If no such file is included
7
+ # then please contact the authors of the Greenbar project at
8
+ # http://rubyforge.org/projects/greenbar/
9
+ #
10
+ $LOAD_PATH << 'lib' << 'test'
11
+ require 'TestSetupTest.rb'
12
+ require 'EnvSetupTest.rb'
13
+ require 'RandSetupTest.rb'
14
+ require 'TimeSetupTest.rb'
15
+ require 'ClassMethodSetupTest.rb'
16
+ require 'DateSetupTest.rb'
17
+ require 'RailsSetupTest.rb'
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.11
3
+ specification_version: 1
4
+ name: greenbar
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.1.1
7
+ date: 2006-04-23 00:00:00 -04:00
8
+ summary: Test::Unit tools.
9
+ require_paths:
10
+ - lib
11
+ email:
12
+ homepage: http://greenbar.rubyforge.org
13
+ rubyforge_project: greenbar
14
+ description: Greenbar is a collection of aids for testing with Test::Unit' <<
15
+ autorequire: greenbar.rb
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ authors:
29
+ - David Corbin, Kiel Hodges
30
+ files:
31
+ - lib/greenbar.rb
32
+ - lib/greenbar/RailsSetup.rb
33
+ - lib/greenbar/DateSetup.rb
34
+ - lib/greenbar/ClassMethodSetup.rb
35
+ - lib/greenbar/EnvSetup.rb
36
+ - lib/greenbar/TimeSetup.rb
37
+ - lib/greenbar/TestSetup.rb
38
+ - lib/greenbar/RandSetup.rb
39
+ - test/allTests.rb
40
+ - test/TestSetupTest.rb
41
+ - test/DateSetupTest.rb
42
+ - test/EnvSetupTest.rb
43
+ - test/RandSetupTest.rb
44
+ - test/RailsSetupTest.rb
45
+ - test/TimeSetupTest.rb
46
+ - test/ClassMethodSetupTest.rb
47
+ - doc/examples/DateSetup.rb
48
+ - doc/examples/ClassMethodSetup_replace_new.rb
49
+ - doc/examples/EnvSetup.rb
50
+ - doc/examples/TimeSetup.rb
51
+ - doc/examples/ClassMethodSetup_define_class_method.rb
52
+ - doc/examples/TestSetup.rb
53
+ - doc/examples/RandSetup.rb
54
+ - doc/examples/ClassMethodSetup_replace_class_method.rb
55
+ - LICENSE
56
+ - README
57
+ - rakefile.rb
58
+ test_files:
59
+ - test/allTests.rb
60
+ rdoc_options:
61
+ - --title
62
+ - Greenbar - Aids for Testing with Test::Unit
63
+ - --main
64
+ - README
65
+ - --line-numbers
66
+ - --inline-source
67
+ extra_rdoc_files:
68
+ - README
69
+ - LICENSE
70
+ executables: []
71
+
72
+ extensions: []
73
+
74
+ requirements: []
75
+
76
+ dependencies: []
77
+