tu-context 0.5.7
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.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/History.txt +10 -0
- data/License.txt +20 -0
- data/Manifest.txt +30 -0
- data/PostInstall.txt +0 -0
- data/README.rdoc +159 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/config/hoe.rb +73 -0
- data/config/requirements.rb +15 -0
- data/context.gemspec +44 -0
- data/countloc.rb +65 -0
- data/lib/context.rb +19 -0
- data/lib/context/context.rb +64 -0
- data/lib/context/core_ext/rails_hacks.rb +10 -0
- data/lib/context/core_ext/string.rb +17 -0
- data/lib/context/lifecycle.rb +103 -0
- data/lib/context/shared_behavior.rb +97 -0
- data/lib/context/suite.rb +39 -0
- data/lib/context/test.rb +37 -0
- data/lib/context/version.rb +9 -0
- data/setup.rb +1585 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/test/test_context.rb +57 -0
- data/test/test_core_ext.rb +25 -0
- data/test/test_helper.rb +2 -0
- data/test/test_lifecycle.rb +224 -0
- data/test/test_nested_lifecycle.rb +44 -0
- data/test/test_shared.rb +116 -0
- data/test/test_shared_lifecycle.rb +24 -0
- data/test/test_test.rb +23 -0
- metadata +108 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestSharedLifecycle < Test::Unit::TestCase
|
4
|
+
|
5
|
+
shared "battery is ok" do
|
6
|
+
test "battery should be ok" do
|
7
|
+
assert_equal :ok, @battery
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
context "starting a car" do
|
12
|
+
before do
|
13
|
+
@battery = :ok
|
14
|
+
@engine = :off
|
15
|
+
end
|
16
|
+
|
17
|
+
uses_examples_from "battery is ok"
|
18
|
+
|
19
|
+
test "engine should be off" do
|
20
|
+
assert_equal :off, @engine
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
data/test/test_test.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestTest < Test::Unit::TestCase
|
4
|
+
def test_test_aliases
|
5
|
+
[:test, :it, :should, :tests].each do |method_alias|
|
6
|
+
assert self.class.respond_to?(method_alias)
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_before_test_aliases
|
11
|
+
[:before_test, :before_it, :before_should, :before_tests].each do |method_alias|
|
12
|
+
assert self.class.respond_to?(method_alias), method_alias.inspect
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
context "A test block" do
|
17
|
+
it "should create a test_xxx method" do
|
18
|
+
self.class.test("should create a test method") { true }
|
19
|
+
|
20
|
+
assert self.respond_to?("test: A test block should create a test method")
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tu-context
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 5
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 5
|
9
|
+
- 7
|
10
|
+
version: 0.5.7
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Jeremy McAnally
|
14
|
+
- Rails Core
|
15
|
+
- Pratik Naik
|
16
|
+
autorequire:
|
17
|
+
bindir: bin
|
18
|
+
cert_chain: []
|
19
|
+
|
20
|
+
date: 2010-07-02 00:00:00 -04:00
|
21
|
+
default_executable:
|
22
|
+
dependencies: []
|
23
|
+
|
24
|
+
description: If you've ever wanted contexts in your Test::Unit tests, then context is for you. Your tests will be easier to read and write without all the magic and extra code smell!
|
25
|
+
email: jeremymcanally@gmail.com
|
26
|
+
executables: []
|
27
|
+
|
28
|
+
extensions: []
|
29
|
+
|
30
|
+
extra_rdoc_files:
|
31
|
+
- README.rdoc
|
32
|
+
files:
|
33
|
+
- .document
|
34
|
+
- .gitignore
|
35
|
+
- History.txt
|
36
|
+
- License.txt
|
37
|
+
- Manifest.txt
|
38
|
+
- PostInstall.txt
|
39
|
+
- README.rdoc
|
40
|
+
- Rakefile
|
41
|
+
- VERSION
|
42
|
+
- config/hoe.rb
|
43
|
+
- config/requirements.rb
|
44
|
+
- context.gemspec
|
45
|
+
- countloc.rb
|
46
|
+
- lib/context.rb
|
47
|
+
- lib/context/context.rb
|
48
|
+
- lib/context/core_ext/rails_hacks.rb
|
49
|
+
- lib/context/core_ext/string.rb
|
50
|
+
- lib/context/lifecycle.rb
|
51
|
+
- lib/context/shared_behavior.rb
|
52
|
+
- lib/context/suite.rb
|
53
|
+
- lib/context/test.rb
|
54
|
+
- lib/context/version.rb
|
55
|
+
- setup.rb
|
56
|
+
- tasks/deployment.rake
|
57
|
+
- tasks/environment.rake
|
58
|
+
- test/test_context.rb
|
59
|
+
- test/test_core_ext.rb
|
60
|
+
- test/test_helper.rb
|
61
|
+
- test/test_lifecycle.rb
|
62
|
+
- test/test_nested_lifecycle.rb
|
63
|
+
- test/test_shared.rb
|
64
|
+
- test/test_shared_lifecycle.rb
|
65
|
+
- test/test_test.rb
|
66
|
+
has_rdoc: true
|
67
|
+
homepage: http://github.com/djsun/tu-context
|
68
|
+
licenses: []
|
69
|
+
|
70
|
+
post_install_message:
|
71
|
+
rdoc_options:
|
72
|
+
- --charset=UTF-8
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
hash: 3
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
version: "0"
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
none: false
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 3
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
version: "0"
|
93
|
+
requirements: []
|
94
|
+
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 1.3.7
|
97
|
+
signing_key:
|
98
|
+
specification_version: 3
|
99
|
+
summary: Adds context blocks for Test::Unit
|
100
|
+
test_files:
|
101
|
+
- test/test_context.rb
|
102
|
+
- test/test_core_ext.rb
|
103
|
+
- test/test_helper.rb
|
104
|
+
- test/test_lifecycle.rb
|
105
|
+
- test/test_nested_lifecycle.rb
|
106
|
+
- test/test_shared.rb
|
107
|
+
- test/test_shared_lifecycle.rb
|
108
|
+
- test/test_test.rb
|