riot 0.11.3 → 0.11.4.pre
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/CHANGELOG +18 -0
- data/VERSION +1 -1
- data/lib/riot.rb +1 -0
- data/lib/riot/context.rb +1 -0
- data/lib/riot/reporter.rb +7 -3
- data/riot.gemspec +5 -3
- data/test/core/context_test.rb +9 -0
- data/test/core/using_describe_in_a_test.rb +25 -0
- metadata +12 -7
data/CHANGELOG
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
*0.11.4.pre*
|
2
|
+
|
3
|
+
* Added `describe` alias for `context` for easier rspec porting. Useful at the top level and within a context. [kriss]
|
4
|
+
|
5
|
+
Who can argue with porting from rspec to riot? Not me. [jaknowlden]
|
6
|
+
|
7
|
+
describe "My thing" do
|
8
|
+
asserts(:size).equals(:small)
|
9
|
+
end # My thing
|
10
|
+
|
11
|
+
The following also works:
|
12
|
+
|
13
|
+
context "Another thing is"
|
14
|
+
describe "my" do
|
15
|
+
asserts_topic.equals("marshmallow") # this test will fail ... because it will ... because it's wrong
|
16
|
+
end # my
|
17
|
+
end # Another thing is
|
18
|
+
|
1
19
|
*0.11.3*
|
2
20
|
|
3
21
|
* Modified `matches` assertion macro to treat actual as a string before executing regular expression comparison. [jaknowlden]
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.11.
|
1
|
+
0.11.4.pre
|
data/lib/riot.rb
CHANGED
data/lib/riot/context.rb
CHANGED
data/lib/riot/reporter.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
module Riot
|
2
2
|
class Reporter
|
3
3
|
attr_accessor :passes, :failures, :errors, :current_context
|
4
|
+
|
4
5
|
def initialize
|
5
6
|
@passes = @failures = @errors = 0
|
6
7
|
@current_context = ""
|
7
8
|
end
|
8
9
|
|
10
|
+
def new(*args, &block); self; end
|
11
|
+
|
9
12
|
def success?; (@failures + @errors) == 0; end
|
13
|
+
|
10
14
|
def summarize(&block)
|
11
15
|
started = Time.now
|
12
16
|
yield
|
@@ -32,9 +36,9 @@ module Riot
|
|
32
36
|
end
|
33
37
|
end
|
34
38
|
|
35
|
-
def
|
36
|
-
|
37
|
-
end
|
39
|
+
def pass(description, result); end
|
40
|
+
def fail(description, message, line, file); end
|
41
|
+
def error(description, result); end
|
38
42
|
end # Reporter
|
39
43
|
|
40
44
|
class IOReporter < Reporter
|
data/riot.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{riot}
|
8
|
-
s.version = "0.11.
|
8
|
+
s.version = "0.11.4.pre"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin 'Gus' Knowlden"]
|
12
|
-
s.date = %q{2010-07
|
12
|
+
s.date = %q{2010-08-07}
|
13
13
|
s.description = %q{An extremely fast, expressive, and context-driven unit-testing framework. A replacement for all other testing frameworks. Protest the slow test.}
|
14
14
|
s.email = %q{gus@gusg.us}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -80,6 +80,7 @@ Gem::Specification.new do |s|
|
|
80
80
|
"test/core/setup_test.rb",
|
81
81
|
"test/core/situation_test.rb",
|
82
82
|
"test/core/teardown_test.rb",
|
83
|
+
"test/core/using_describe_in_a_test.rb",
|
83
84
|
"test/extensions/rrriot_test.rb",
|
84
85
|
"test/teststrap.rb"
|
85
86
|
]
|
@@ -120,6 +121,7 @@ Gem::Specification.new do |s|
|
|
120
121
|
"test/core/setup_test.rb",
|
121
122
|
"test/core/situation_test.rb",
|
122
123
|
"test/core/teardown_test.rb",
|
124
|
+
"test/core/using_describe_in_a_test.rb",
|
123
125
|
"test/extensions/rrriot_test.rb",
|
124
126
|
"test/teststrap.rb"
|
125
127
|
]
|
data/test/core/context_test.rb
CHANGED
@@ -146,3 +146,12 @@ context "A context with premium_setup" do
|
|
146
146
|
|
147
147
|
asserts("order of setups ensures topic") { SingletonArray.values }.equals(%w[foo bar baz])
|
148
148
|
end
|
149
|
+
|
150
|
+
context "The describe alias" do
|
151
|
+
setup do
|
152
|
+
Riot::Context.new("Foo") {}
|
153
|
+
end
|
154
|
+
|
155
|
+
asserts("any ol' object") { Object.new }.responds_to(:describe)
|
156
|
+
asserts_topic.responds_to :describe
|
157
|
+
end # The describe alias
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'teststrap'
|
2
|
+
|
3
|
+
describe "This describe context" do
|
4
|
+
setup { "another thing is my" }
|
5
|
+
asserts_topic.kind_of(String)
|
6
|
+
end # This describe context
|
7
|
+
|
8
|
+
context "Using a describe sub-context" do
|
9
|
+
setup do
|
10
|
+
Riot::Context.new("Foo") do
|
11
|
+
describe "using describe" do
|
12
|
+
setup { "another thing is my" }
|
13
|
+
asserts_topic.kind_of(String)
|
14
|
+
end
|
15
|
+
end.run(Riot::Reporter.new)
|
16
|
+
end
|
17
|
+
|
18
|
+
asserts("current context description") do
|
19
|
+
topic.current_context.detailed_description
|
20
|
+
end.equals("Foo using describe")
|
21
|
+
|
22
|
+
asserts(:passes).equals(1)
|
23
|
+
asserts(:failures).equals(0)
|
24
|
+
asserts(:errors).equals(0)
|
25
|
+
end # Using a describe sub-context
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
4
|
+
prerelease: true
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 11
|
8
|
-
-
|
9
|
-
|
8
|
+
- 4
|
9
|
+
- pre
|
10
|
+
version: 0.11.4.pre
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Justin 'Gus' Knowlden
|
@@ -14,7 +15,7 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-07
|
18
|
+
date: 2010-08-07 00:00:00 -05:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
@@ -114,6 +115,7 @@ files:
|
|
114
115
|
- test/core/setup_test.rb
|
115
116
|
- test/core/situation_test.rb
|
116
117
|
- test/core/teardown_test.rb
|
118
|
+
- test/core/using_describe_in_a_test.rb
|
117
119
|
- test/extensions/rrriot_test.rb
|
118
120
|
- test/teststrap.rb
|
119
121
|
has_rdoc: true
|
@@ -134,11 +136,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
134
136
|
version: "0"
|
135
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
138
|
requirements:
|
137
|
-
- - "
|
139
|
+
- - ">"
|
138
140
|
- !ruby/object:Gem::Version
|
139
141
|
segments:
|
140
|
-
-
|
141
|
-
|
142
|
+
- 1
|
143
|
+
- 3
|
144
|
+
- 1
|
145
|
+
version: 1.3.1
|
142
146
|
requirements: []
|
143
147
|
|
144
148
|
rubyforge_project:
|
@@ -178,5 +182,6 @@ test_files:
|
|
178
182
|
- test/core/setup_test.rb
|
179
183
|
- test/core/situation_test.rb
|
180
184
|
- test/core/teardown_test.rb
|
185
|
+
- test/core/using_describe_in_a_test.rb
|
181
186
|
- test/extensions/rrriot_test.rb
|
182
187
|
- test/teststrap.rb
|