-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathCHANGELOG
369 lines (270 loc) · 9.16 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
# @markup markdown
# 0.12.6
* Catch and report on errors that occur while running middleware. Context with error in middleware will not run.
* Errors that occur during a setup, hookup, or teardown are handled gracefully
* close #31 - RR seems to carry over some latent varification state between situations
# 0.12.5
* Remove doc for some deprecated macros: not, exists, any [charlietanskley]
* Deprecate two more macros [charlietanskley]
* make riot run -w clean. None of those pesky warnings [achiu]
* Use #inspect for printing arguments in error results [Mon-Ouie]
* Move BlankSlate into Riot namespace [Mon-Ouie]
* Setting options in a sub-context don't leak back into the parent context [skade]
* Remove deprecated `not!` macro [charlietanksley]
* Fix all warnings so riot runs `-w` clean
# 0.12.4
* Adding Riot.plain! option for not printing output in color [c00lryguy,
jaknowlden]
# 0.12.3
* Going nuts with context helpers: should_not, asserts/denies_topic arguments [achiu]
This works now: `should_not("do something")` as an alias for `denies`
You can now pass arguments to `asserts`, `denies`, `should`, and `should_not`.
```
context "Playing with hashes" do
setup do
{ "foo" => "bar" }
end
asserts(:[], "foo").equals("bar")
should(:[], "foo").equals("bar")
denies(:[], "foo").equals("goo")
should_not(:[], "foo").equals("goo")
end # Playing with hashes
```
* Exit gracefully if a child process exited with failing status [timgaleckas]
No tests will run in this situation.
* No status displayed if no tests run [timgaleckas]
* Adding a `denies_topic` macro to Context [Mon-Ouie]
# 0.12.2
* RDoc'ed the hell out of everything [jaknowlden]
* Deprecating the not! assertion macro. It may just be gone by 0.13.0 [jaknowlden]
* Remove ANSI-color dependency [achiu]
* Switch from Jeweler to Bundler [achiu]
* Add PrettyDotMatrixReporter [achiu]
# 0.12.1
* Error reporting now filters the backtrace to include only meaningful line items. [mbriggs]
* Added ability to pass method arguments to asserts. [sirupsen]
# 0.12.0
* Negative tests are finally here! Added support for `denies` and adjusted macros to care about it with `devaluate`. [jaknowlden, achiu]
```
denies("my name") { "Rumplestiltzkin" }.equals("Henry")
```
# 0.11.4
* [skade] Passing Proc's instead of lambdas to `instance_eval` to comply with ruby 1.9.2.
* [nu7hatch] Added `describe` alias for `context` for easier rspec porting. Useful at the top level and within a context.
Who can argue with porting from rspec to riot? Not me.
```
describe "My thing" do
asserts(:size).equals(:small)
end # My thing
```
The following also works:
```
context "Another thing is"
describe "my" do
asserts_topic.equals("marshmallow") # this test will fail ... because it will ... because it's wrong
end # my
end # Another thing is
```
# 0.11.3
* [jaknowlden] Modified `matches` assertion macro to treat actual as a string before executing regular expression comparison.
```
asserts("a number") { 42 }.matches(/\d+/)
# same as
asserts("a number as string") { "42" }.matches(/\d+/)
```
# 0.11.2
* [jaknowlden] [ISSUE] Options were not nesting. Now fixed.
# 0.11.1
* [jaknowlden] Middleware can now acts more like you would expect. Middleware now know the next neighbor in the chain and can do stuff to the context before and after the user-defined context is prepared. Removes support for the handle? method. Now we act more like a Rack app.
```
class MyMiddleware < Riot::ContextMiddleware
register
def call(context)
context.setup { "fooberries" }
middleware.call(context)
context.hookup { "furberries" } if context.option(:barns)
end
end
```
# 0.11.0
* [jaknowlden] Added option to Context#setup which puts the specific setup block at the beginning of the setups to be called for a context. Also useful for middlewares.
```
context "Foo" do
setup { puts "called second" }
setup { puts "called third" }
setup(true) { puts "called first" }
end # Foo
```
* [jaknowlden] Added idea of options for a context. This is another feature picked up from riot-rails work.
Essentially, these are useful for middlewares. For instance, if you wanted to tell a middleware that was looking for a "transactional" option before running code in a transaction block, you might do this:
```
context User do
set :transactional, true
end # User
```
The middleware might do something with it:
```
class TransactionalMiddleware < Riot::ContextMiddleware
register
def handle?(context) context.option(:transactional) == true; end
def prepare(context)
# transactional stuff
end
end # TransactionalMiddleware
```
You can call set as many times as you like
```
context User do
set :transactional, true
set :foo, :bar
end
```
* [jaknowlden] ContextMiddleware: a construction pattern that allows for custom code to be applied to any context given that the middleware chooses to.
This is something I started building into riot-rails and decided it was useful enough to just put it into riot itself. If, for instance, you wanted to add a setup with some stuff only if the context description was equal to "Your Mom":
```
class YourMomMiddleware < Riot::ContextMiddleware
register
def handle?(context)
context.description == "Your Mom"
end
def prepare(context)
context.setup do
"your mom is the topic"
end
end
end # YourMomMiddleware
```
# 0.10.13
* [jaknowlden] Helpers are now run with other setups, not separately. Which means you could use a helper in a setup.
```
context "Foo" do
helper(:user) { User.new }
setup do
Baz.new(:user => user) # :)
end
end # Foo
```
* [vandrijevik] Correctly report non-RR assertion failures and errors when RR is used.
```
context "Foo.bar" do
asserts("baz is called") do
mock(Foo).baz
raise RuntimeError.new("oh noes")
end
end
```
would previously return [:fail, "baz() Called 0 times. Expected 1 times."], and will now correctly return [:error, #<RuntimeError: oh noes>]
* [jaknowlden] Recording description as is. Providing #detailed_description for proper behavior
```
foo_context = context(Foo) {}
bar_context = foo_context.context(Bar) {}
bar_context.description
=> Bar
bar_context.detailed_description
=> "Foo Bar"
```
* [jaknowlden] No longer assuming topic when no block provided to an assertion. Instead, assuming block fails by default. Use `asserts_topic` only now.
```
context "foo" do
setup { "bar" }
asserts_topic.kind_of(String)
asserts("topic").kind_of(String) # Will fail since block returns `false`
asserts("topic").equals(false) # Will actually pass :)
end
```
# 0.10.12
* [vandrijevik] Recognizing file and line number of an assertion declaration on failure
* [vandrijevik,jaknowlden] RR support in Riot
```
# teststrap.rb
require 'riot'
require 'riot/rr'
# your-test.rb
context "foo" do
asserts("failure due to not calling hello") { mock!.hello {"world"} } # actually fails
end
```
* [jaknowlden] Added Riot::Message to make messages in macros easier to write
```
def evaluate(actual, expected)
# ...
expected == actual pass(new_message.received(expected)) ? fail(expected(expected).not(actual))
# ...
end
```
* [jaknowlden] Added responds_to as a respond_to alias
* [jaknowlden] Added the equivalent_to macro to compare case equality (===). equals is now (==)
* [jaknowlden] Assuming RootContext if nil parent provided. Added Context#parent to the API
```
Riot::Context.new("Hi", nil) {}.parent.class
=> Riot::RootContext
```
# 0.10.11
* [gabrielg, jaknowlden] Context#asserts_topic now takes an optional description
```
asserts_topic.exists
asserts_topic("some kind of description").exists
```
* [gabrielg, jaknowlden] Added not! assertion macro
```
setup { User.new(:funny? => false) }
asserts(:funny?).not!
```
* [jaknowlden] Added Context#hookup to add some setup code to an already defined topic
```
context "yo mama" do
setup { YoMama.new }
# ...
context "is cool" do
hookup { topic.do_something_involving_state }
asserts_topic.kind_of?(YoMama)
end
end
```
* [jaknowlden] Added Riot.alone! mode to ensure Riot.run is not run at-exit
```
Riot.alone!
Riot.run
```
This will still print output unless you also Riot.silently!
* [gabrielg, jaknowlden] Returning non-zero status at-exit when tests don't pass
# 0.10.10
* [dasch, jaknowlden] Passing assertion macros can now return a custom message
```
def evaluate(actual, *expectings)
1 == 1 ? pass("1 does equal 1") : fail("1 does not equal 1 in this universe")
end
```
* [jaknowlden] Removing Context#extend_assertions and related code
* [dasch] Allow the use of symbolic descriptions as shorthands for sending the message to the topic
```
setup { "foo" }
asserts(:upcase).equals("FOO")
```
* [jaknowlden, splattael] Added AssertionMacro and #register for macros
```
module My
class CustomThingAssertion < Riot::AssertionMacro
register :custom_thing
expects_exception!
def evaluate(actual, *expectings)
# ...
end
end
Riot::Assertion.register_macro :custom_thing, CustomThingAssertion
end
```
* [splattael] Replace IOReporter#say with #puts. Also add #print.
```
class SomeNewReporter < IOReporter
def pass
puts "I PASSED"
end
def fail
print "F"
end
# ...
end
```
# 0.10.9 and before
See the commit log: http://github.com/thumblemonks/riot/commits/master