assay 0.4.1 → 0.5.0

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.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +7 -0
  3. data/HISTORY.md +128 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +287 -0
  6. data/demo/ae/01_overview.md +98 -0
  7. data/demo/ae/03_assert.md +398 -0
  8. data/demo/ae/04_subjunctive.md +100 -0
  9. data/demo/ae/05_expect.md +136 -0
  10. data/demo/ae/06_counts.md +33 -0
  11. data/demo/ae/07_matchers.md +34 -0
  12. data/demo/ae/08_check.md +61 -0
  13. data/demo/ae/09_assay.md +124 -0
  14. data/demo/ae/applique/setup.rb +11 -0
  15. data/{test → demo/applique}/helper.rb +8 -2
  16. data/demo/applique/setup.rb +1 -0
  17. data/demo/bang/01_bang.md +220 -0
  18. data/demo/core/00_introduction.md +2 -0
  19. data/demo/core/01_assay_classes/00_introduction.md +2 -0
  20. data/demo/core/01_assay_classes/01_nil_assay.md +35 -0
  21. data/demo/core/01_assay_classes/02_boolean_assay.md +35 -0
  22. data/demo/core/01_assay_classes/03_false_assay.md +19 -0
  23. data/demo/core/01_assay_classes/03_true_assay.md +20 -0
  24. data/demo/core/01_assay_classes/04_like_assay.md +19 -0
  25. data/demo/core/01_assay_classes/05_equal_assay.md +19 -0
  26. data/demo/core/01_assay_classes/06_unequal_assay.md +35 -0
  27. data/demo/core/01_assay_classes/07_equality_assay.md +19 -0
  28. data/demo/core/01_assay_classes/08_identity_assay.md +24 -0
  29. data/demo/core/01_assay_classes/09_case_assay.md +22 -0
  30. data/demo/core/01_assay_classes/10_match_assay.md +15 -0
  31. data/demo/core/01_assay_classes/11_nomatch_assay.md +16 -0
  32. data/demo/core/01_assay_classes/12_compare_assay.md +24 -0
  33. data/demo/core/01_assay_classes/13_less_assay.md +29 -0
  34. data/demo/core/01_assay_classes/14_more_assay.md +29 -0
  35. data/demo/core/01_assay_classes/15_less_equal_assay.md +30 -0
  36. data/demo/core/01_assay_classes/16_more_equal_assay.md +29 -0
  37. data/demo/core/01_assay_classes/17_close_assay.md +42 -0
  38. data/demo/core/01_assay_classes/17_within_assay.md +42 -0
  39. data/demo/core/01_assay_classes/18_kind_assay.md +17 -0
  40. data/demo/core/01_assay_classes/19_instance_assay.md +16 -0
  41. data/demo/core/01_assay_classes/20_include_assay.md +17 -0
  42. data/demo/core/01_assay_classes/21_empty_assay.md +15 -0
  43. data/demo/core/01_assay_classes/22_respond_assay.md +15 -0
  44. data/demo/core/01_assay_classes/23_execution_assay.md +40 -0
  45. data/demo/core/01_assay_classes/23_return_assay.md +37 -0
  46. data/demo/core/01_assay_classes/24_rescue_assay.md +40 -0
  47. data/demo/core/01_assay_classes/25_raise_assay.md +40 -0
  48. data/demo/core/01_assay_classes/26_throw_assay.md +47 -0
  49. data/demo/core/01_assay_classes/27_path_assay.md +20 -0
  50. data/demo/core/01_assay_classes/28_directory_assay.md +21 -0
  51. data/demo/core/01_assay_classes/29_file_assay.md +20 -0
  52. data/demo/core/01_assay_classes/30_output_assay.md +39 -0
  53. data/demo/core/01_assay_classes/31_stdout_assay.md +21 -0
  54. data/demo/core/01_assay_classes/32_stderr_assay.md +21 -0
  55. data/demo/core/02_lookup.md +25 -0
  56. data/demo/core/03_assertor.md +117 -0
  57. data/demo/core/04_assay.md +40 -0
  58. data/demo/fluidity/00_intro.md +7 -0
  59. data/demo/fluidity/01_should.md +52 -0
  60. data/demo/fluidity/02_must.md +58 -0
  61. data/demo/fluidity/03_assert.md +71 -0
  62. data/demo/fluidity/04_other.md +35 -0
  63. data/demo/fluidity/05_object_methods.md +102 -0
  64. data/demo/minitest/01_minitest_extensions.rdoc +217 -0
  65. data/demo/minitest/02_minitest_assertions.rdoc +250 -0
  66. data/demo/rspec/00_introduction.md +16 -0
  67. data/demo/rspec/01_should.md +24 -0
  68. data/demo/rspec/02_matchers.md +176 -0
  69. data/demo/rspec/03_have.md +51 -0
  70. data/demo/rspec/04_expect.md +49 -0
  71. data/demo/rspec/applique/setup.rb +2 -0
  72. data/demo/testunit/01_testunit_assertions.md +266 -0
  73. data/lib/assay/adapter/minitest.rb +32 -21
  74. data/lib/assay/adapter/testunit.rb +31 -38
  75. data/lib/assay/ae/assert.rb +77 -0
  76. data/lib/assay/ae/assertor.rb +453 -0
  77. data/lib/assay/ae/check.rb +154 -0
  78. data/lib/assay/ae/core_ext.rb +146 -0
  79. data/lib/assay/ae/expect.rb +72 -0
  80. data/lib/assay/ae/must.rb +64 -0
  81. data/lib/assay/ae/should.rb +58 -0
  82. data/lib/assay/ae/subjunctive.rb +66 -0
  83. data/lib/assay/ae.rb +29 -0
  84. data/lib/assay/assertable.rb +21 -5
  85. data/lib/assay/assertor.rb +4 -4
  86. data/lib/assay/bang.rb +147 -0
  87. data/lib/assay/close_assay.rb +2 -2
  88. data/lib/assay/core_ext/kernel.rb +4 -8
  89. data/lib/assay/fluidity/assert.rb +27 -0
  90. data/lib/assay/fluidity/grammar.rb +157 -0
  91. data/lib/assay/fluidity/is.rb +18 -0
  92. data/lib/assay/fluidity/must.rb +38 -0
  93. data/lib/assay/fluidity/should.rb +32 -0
  94. data/lib/assay/fluidity/will.rb +36 -0
  95. data/lib/assay/fluidity.rb +6 -0
  96. data/lib/assay/less_assay.rb +7 -1
  97. data/lib/assay/less_equal_assay.rb +7 -1
  98. data/lib/assay/minitest/assertions.rb +495 -0
  99. data/lib/assay/minitest/extensions.rb +496 -0
  100. data/lib/assay/minitest.rb +24 -0
  101. data/lib/assay/more_assay.rb +7 -1
  102. data/lib/assay/more_equal_assay.rb +7 -1
  103. data/lib/assay/rspec/expect.rb +151 -0
  104. data/lib/assay/rspec/have.rb +201 -0
  105. data/lib/assay/rspec/matchers.rb +272 -0
  106. data/lib/assay/rspec/operatics.rb +60 -0
  107. data/lib/assay/rspec/should.rb +49 -0
  108. data/lib/assay/rspec.rb +13 -0
  109. data/lib/assay/testunit/assertions.rb +484 -0
  110. data/lib/assay/testunit.rb +9 -0
  111. data/lib/assay/version.rb +3 -0
  112. data/lib/assay.rb +7 -21
  113. metadata +211 -80
  114. data/.ruby +0 -51
  115. data/COPYING.rdoc +0 -38
  116. data/HISTORY.rdoc +0 -65
  117. data/QED.rdoc +0 -1143
  118. data/README.rdoc +0 -173
  119. data/lib/assay.yml +0 -51
  120. data/test/case_compare_assay.rb +0 -59
  121. data/test/case_empty_assay.rb +0 -51
  122. data/test/case_equal_assay.rb +0 -53
  123. data/test/case_equality_assay.rb +0 -55
  124. data/test/case_false_assay.rb +0 -48
  125. data/test/case_identity_assay.rb +0 -51
  126. data/test/case_include_assay.rb +0 -51
  127. data/test/case_instance_assay.rb +0 -51
  128. data/test/case_kind_assay.rb +0 -51
  129. data/test/case_less_assay.rb +0 -53
  130. data/test/case_less_equal_assay.rb +0 -53
  131. data/test/case_like_assay.rb +0 -57
  132. data/test/case_match_assay.rb +0 -45
  133. data/test/case_more_assay.rb +0 -53
  134. data/test/case_more_equal_assay.rb +0 -53
  135. data/test/case_nil_assay.rb +0 -48
  136. data/test/case_nomatch_assay.rb +0 -47
  137. data/test/case_raise_assay.rb +0 -51
  138. data/test/case_respond_assay.rb +0 -51
  139. data/test/case_throw_assay.rb +0 -51
  140. data/test/case_true_assay.rb +0 -48
  141. data/test/case_unequal_assay.rb +0 -55
  142. data/test/case_within_assay.rb +0 -61
@@ -0,0 +1,49 @@
1
+ ## RSpec Expect
2
+
3
+ ### expect
4
+
5
+ Expect is RSpecs new and approved assertion notation. It works
6
+ very much like `#should` but it isn't an Object extension, which
7
+ is considered a "*better practice*".
8
+
9
+ expect(10).to eq(10)
10
+
11
+ ### operators
12
+
13
+ It can also delegate operators, so the above example can also be
14
+ written.
15
+
16
+ expect(10).to == 10
17
+
18
+ assert_raises EqualAssay do
19
+ expect(10).to == 20
20
+ end
21
+
22
+
23
+ Any other operator is sent to the object, and has to come back true.
24
+
25
+ expect(10).to > 5
26
+
27
+ assert_raises LessEqualAssay do
28
+ expect(10).to <= 5
29
+ end
30
+
31
+ Only operators are delegated. A named method is an error, because
32
+ the RSpec notation has matchers for those.
33
+
34
+ assert_raises NoMethodError do
35
+ expect(10).to.kind_of?(String)
36
+ end
37
+
38
+ ### blocks
39
+
40
+ Given a block instead of a value, `expect` passes the block to the
41
+ matcher, which is how raising and throwing are tested.
42
+
43
+ expect{ raise ArgumentError }.to raise_error(ArgumentError)
44
+
45
+ expect{ :fine }.to_not raise_error(ArgumentError)
46
+
47
+ assert_raises RaiseAssay do
48
+ expect{ :fine }.to raise_error(ArgumentError)
49
+ end
@@ -0,0 +1,2 @@
1
+ require 'assay/rspec'
2
+ include ::Assay::Matchers
@@ -0,0 +1,266 @@
1
+ # Assertion Methods
2
+
3
+ To use the assertion methods, first require the library.
4
+
5
+ require 'assay/testunit'
6
+
7
+ Then include them into your test scope.
8
+
9
+ include ::Assay::Assertions
10
+
11
+ ## assert_equal
12
+
13
+ assert_equal(1,1)
14
+
15
+ expect ::EqualAssay do
16
+ assert_equal(1,2)
17
+ end
18
+
19
+ assert_not_equal(1,2)
20
+
21
+ ## assert_true
22
+
23
+ assert_true(true)
24
+
25
+ expect ::TrueAssay do
26
+ assert_true(false)
27
+ end
28
+
29
+ assert_not_true(false)
30
+ assert_not_true(nil)
31
+
32
+ ## assert_false
33
+
34
+ assert_false(false)
35
+
36
+ expect ::FalseAssay do
37
+ assert_false(true)
38
+ end
39
+
40
+ assert_not_false(true)
41
+ assert_not_false(nil)
42
+
43
+ ## assert_nil
44
+
45
+ assert_nil(nil)
46
+
47
+ expect ::NilAssay do
48
+ assert_nil(true)
49
+ end
50
+
51
+ assert_not_nil(true)
52
+ assert_not_nil(false)
53
+
54
+ ## assert_in_delta
55
+
56
+ assert_in_delta(1, 1.5, 2)
57
+
58
+ expect ::WithinAssay do
59
+ assert_in_delta(1, 2.5, 1)
60
+ end
61
+
62
+ assert_not_in_delta(1, 2, 0.5)
63
+
64
+ ## assert_in_epsilon
65
+
66
+ assert_in_epsilon(1, 1.5, 2)
67
+ assert_in_epsilon(0, 1.5, 2)
68
+
69
+ expect ::CloseAssay do
70
+ assert_in_epsilon(1, 2.5, 1)
71
+ end
72
+
73
+ assert_not_in_epsilon(1, 2.5, 1)
74
+ assert_not_in_epsilon(0, 2.5, 1)
75
+
76
+ ## assert_match
77
+
78
+ assert_match(/a/, "abc")
79
+
80
+ expect ::MatchAssay do
81
+ assert_match(/x/, "abc")
82
+ end
83
+
84
+ assert_not_match(/a/, "bcd")
85
+
86
+ ## assert_no_match
87
+
88
+ assert_no_match(/a/, "bcd")
89
+
90
+ expect ::NoMatchAssay do
91
+ assert_no_match(/a/, "abc")
92
+ end
93
+
94
+ ## assert_empty
95
+
96
+ assert_empty([])
97
+
98
+ expect ::EmptyAssay do
99
+ assert_empty([1,2,3])
100
+ end
101
+
102
+ assert_not_empty([1,2,3])
103
+
104
+ ## assert_include
105
+
106
+ assert_includes([1,2,3], 1)
107
+
108
+ expect ::IncludeAssay do
109
+ assert_includes([1,2,3], 4)
110
+ end
111
+
112
+ assert_not_includes([1,2,3], 4)
113
+
114
+ ## assert_same
115
+
116
+ assert_same(:a, :a)
117
+
118
+ expect ::IdentityAssay do
119
+ assert_same("a", "a")
120
+ end
121
+
122
+ assert_not_same(:a, :b)
123
+
124
+ ## assert_instance_of
125
+
126
+ assert_instance_of(Integer, 1)
127
+
128
+ expect ::InstanceAssay do
129
+ assert_instance_of(String, 1)
130
+ end
131
+
132
+ assert_not_instance_of(String, 1)
133
+
134
+ ## assert_kind_of
135
+
136
+ assert_kind_of(Integer, 1)
137
+
138
+ expect ::KindAssay do
139
+ assert_kind_of(String, 1)
140
+ end
141
+
142
+ assert_not_kind_of(String, 1)
143
+
144
+ ## assert_raise
145
+
146
+ assert_raise(ArgumentError){ raise ArgumentError }
147
+
148
+ expect ::RaiseAssay do
149
+ assert_raise(ArgumentError){ raise TypeError }
150
+ end
151
+
152
+ assert_not_raised(ArgumentError){ raise TypeError }
153
+
154
+ ## assert_raise_kind_of
155
+
156
+ assert_raise_kind_of(StandardError){ raise }
157
+
158
+ expect ::RescueAssay do
159
+ assert_raise_kind_of(ArgumentError){ raise TypeError }
160
+ end
161
+
162
+ assert_raise_kind_of(Exception){ raise }
163
+
164
+ ## assert_nothing_raised
165
+
166
+ assert_nothing_raised{ true }
167
+ assert_nothing_raised{ nil }
168
+
169
+ expect ::RescueAssay do
170
+ assert_nothing_raised{ raise }
171
+ end
172
+
173
+ ## assert_respond_to
174
+
175
+ assert_respond_to("string", :upcase)
176
+
177
+ expect ::RespondAssay do
178
+ assert_respond_to("string", :not_a_method)
179
+ end
180
+
181
+ assert_not_respond_to("string", :not_a_method)
182
+
183
+ ## assert_block
184
+
185
+ assert_block{ :ok }
186
+
187
+ expect ::ExecutionAssay do
188
+ assert_block{ raise }
189
+ end
190
+
191
+ ## assert_throw
192
+
193
+ assert_throw(:foo){ throw :foo }
194
+
195
+ expect ::ThrowAssay do
196
+ assert_throw(:foo){ throw :bar }
197
+ end
198
+
199
+ assert_not_thrown(:foo){ throw :bar }
200
+
201
+ ## assert_nothing_thrown
202
+
203
+ assert_nothing_thrown{ nil }
204
+
205
+ expect ::ThrowAssay do
206
+ assert_nothing_thrown{ throw :bar }
207
+ end
208
+
209
+ ## assert_compare
210
+
211
+ assert_compare(1, :<, 2)
212
+ assert_compare(2, :>, 1)
213
+ assert_compare(1, :<=, 1)
214
+ assert_compare(1, :>=, 1)
215
+ assert_compare(1, :<=, 2)
216
+ assert_compare(2, :>=, 1)
217
+ assert_compare(1, :==, 1)
218
+
219
+ expect ArgumentError do
220
+ assert_compare(1, :<=>, 1)
221
+ end
222
+
223
+ ## assert_operator
224
+
225
+ assert_operator([], :<<, 1)
226
+
227
+ ## assert_predicate
228
+
229
+ assert_predicate(10, :even?)
230
+
231
+ assert_not_predicate(10, :odd?)
232
+
233
+ ## assert_path_exist
234
+
235
+ assert_path_exist(__FILE__)
236
+
237
+ assert_path_not_exist(__FILE__ + '.foobar')
238
+
239
+ ## assert_boolean
240
+
241
+ assert_boolean(true)
242
+ assert_boolean(false)
243
+
244
+ assert_not_boolean(nil)
245
+
246
+ ## assert_alike
247
+
248
+ assert_alike(1,1)
249
+ assert_alike(1,1.0)
250
+
251
+ expect ::LikeAssay do
252
+ assert_alike(1,"1")
253
+ end
254
+
255
+ assert_not_alike(1,"1")
256
+
257
+ ## assert_equivalent
258
+
259
+ assert_equivalent(1, 1)
260
+
261
+ expect ::EqualityAssay do
262
+ assert_equivalent(1, 1.0)
263
+ end
264
+
265
+ assert_not_equivalent(1, 1.0)
266
+
@@ -1,25 +1,36 @@
1
- module MiniTest #:nodoc:
2
- class Unit #:nodoc:
3
- # To teach MiniTest to recognize the expanded concept of assertions
4
- # we add in an extra capture clause to the it's #puke method.
5
- def puke c, m, x
6
- case x
7
- when MiniTest::Skip
8
- @skips = @skips + 1
9
- x = "Skipped:\n#{m}(#{c}) [#{location x}]:\n#{x.message}\n"
10
- when MiniTest::Assertion
11
- @failures = @failures + 1
12
- x = "Failure:\n#{m}(#{c}) [#{location x}]:\n#{x.message}\n"
13
- when x.respond_to?(:assertion?) && x.assertion?
14
- @failures = @failures + 1
15
- x = "Failure:\n#{m}(#{c}) [#{location x}]:\n#{x.message}\n"
16
- else
17
- @errors = @errors + 1
18
- b = MiniTest::filter_backtrace(x.backtrace).join("\n ")
19
- x = "Error:\n#{m}(#{c}):\n#{x.class}: #{x.message}\n #{b}\n"
1
+ require 'minitest'
2
+
3
+ module Assay
4
+ module Adapter
5
+
6
+ # Teaches Minitest that any exception answering true to `assertion?`
7
+ # (the BRASS standard) is a failed assertion, not an error. Without
8
+ # this Minitest still runs tests that use Assay, but counts their
9
+ # failures as errors.
10
+ #
11
+ # Loaded with `require 'assay/adapter/minitest'`. Needs Minitest 5
12
+ # or newer.
13
+ #
14
+ module Minitest
15
+
16
+ def capture_exceptions
17
+ super do
18
+ begin
19
+ yield
20
+ rescue ::Minitest::Assertion, *::Minitest::Test::PASSTHROUGH_EXCEPTIONS
21
+ raise
22
+ rescue Exception => error
23
+ raise unless error.respond_to?(:assertion?) && error.assertion?
24
+ failure = ::Minitest::Assertion.new(error.message)
25
+ failure.set_backtrace(error.backtrace)
26
+ raise failure
27
+ end
28
+ end
20
29
  end
21
- @report << x
22
- x[0, 1]
30
+
23
31
  end
32
+
24
33
  end
25
34
  end
35
+
36
+ Minitest::Test.prepend(Assay::Adapter::Minitest)
@@ -1,42 +1,35 @@
1
- module Test #:nodoc:
2
- module Unit #:nodoc:
3
- class TestCase #:nodoc:
4
- # Runs the individual test method represented by this
5
- # instance of the fixture, collecting statistics, failures
6
- # and errors in result.
7
- def run(result)
8
- yield(STARTED, name)
9
- @_result = result
10
- begin
11
- setup
12
- __send__(@method_name)
13
- rescue AssertionFailedError => e
14
- add_failure(e.message, e.backtrace)
15
- rescue Exception => e
16
- if e.respond_to?(:assertion?) && e.assertion?
17
- add_failure(e.message, e.backtrace)
18
- else
19
- raise if PASSTHROUGH_EXCEPTIONS.include? $!.class
20
- add_error($!)
21
- end
22
- ensure
23
- begin
24
- teardown
25
- rescue AssertionFailedError => e
26
- add_failure(e.message, e.backtrace)
27
- rescue Exception => e
28
- if e.respond_to?(:assertion?) && e.assertion?
29
- add_failure(e.message, e.backtrace)
30
- else
31
- raise if PASSTHROUGH_EXCEPTIONS.include? $!.class
32
- add_error($!)
33
- end
34
- end
35
- end
36
- result.add_run
37
- yield(FINISHED, name)
38
- end
1
+ require 'test/unit'
2
+
3
+ module Assay
4
+ module Adapter
5
+
6
+ # Teaches Test::Unit that any exception answering true to `assertion?`
7
+ # (the BRASS standard) is a failed assertion, not an error. Without
8
+ # this Test::Unit still runs tests that use Assay, but counts their
9
+ # failures as errors.
10
+ #
11
+ # Loaded with `require 'assay/adapter/testunit'`. Needs the test-unit
12
+ # gem, version 3 or newer.
13
+ #
14
+ module TestUnit
15
+
16
+ def self.included(base)
17
+ base.exception_handler(:handle_brass_assertion)
18
+ end
19
+
20
+ private
21
+
22
+ def handle_brass_assertion(exception)
23
+ return false if exception.is_a?(::Test::Unit::AssertionFailedError)
24
+ return false unless exception.respond_to?(:assertion?) && exception.assertion?
25
+ problem_occurred
26
+ add_failure(exception.message, exception.backtrace)
27
+ true
28
+ end
29
+
39
30
  end
31
+
40
32
  end
41
33
  end
42
34
 
35
+ Test::Unit::TestCase.send(:include, Assay::Adapter::TestUnit)
@@ -0,0 +1,77 @@
1
+ require_relative 'assertor'
2
+
3
+ module Assay::AE
4
+
5
+ # The Assert module holds the core extension methods `assert`, `refute`
6
+ # and `flunk`. `require 'assay/ae'` includes it in Object.
7
+ module Assert
8
+
9
+ # Assert a operational relationship.
10
+ #
11
+ # 4.assert == 3
12
+ #
13
+ # If only a single test argument is given then #assert
14
+ # simply validates that it evalutate to true. An optional
15
+ # message argument can be given in this case which will
16
+ # be used instead of the deafult message.
17
+ #
18
+ # assert(4==3, "not the same thing")
19
+ #
20
+ # In block form, #assert ensures the block evalutes
21
+ # truthfully, i.e. not as nil or false.
22
+ #
23
+ # assert{ 4==3 }
24
+ #
25
+ # @return [Assertor] Assertion functor.
26
+ def assert(*args, &block)
27
+ Assertor.new(self, :backtrace=>caller).assert(*args, &block)
28
+ end
29
+
30
+ # Same as 'object.assert == other'.
31
+ #
32
+ # @return [Assertor] Assertion functor.
33
+ def assert=(cmp)
34
+ Assertor.new(self, :backtrace=>caller).assert == cmp
35
+ end
36
+
37
+ # Opposite of assert.
38
+ #
39
+ # 4.refute == 4 #=> Assertion Error
40
+ #
41
+ # @return [Assertor] Assertion functor.
42
+ def refute(*args, &block)
43
+ Assertor.new(self, :backtrace=>caller).not.assert(*args, &block)
44
+ end
45
+
46
+ # Same as 'object.refute == other'.
47
+ #
48
+ # @return [Assertor] Assertion functor.
49
+ def refute=(cmp)
50
+ Assertor.new(self, :backtrace=>caller).not.assert == cmp
51
+ end
52
+
53
+ # Alias for #refute. Read it as "assert not".
54
+ #
55
+ # 4.assert! == 4
56
+ #
57
+ alias_method :assert!, :refute
58
+
59
+ # Directly raise an Assertion failure.
60
+ #
61
+ # @param message [String]
62
+ # Error message.
63
+ #
64
+ # @param backtrace [String]
65
+ # Backtrace, used to pass up an error from lower in the stack.
66
+ #
67
+ # @raise [Assertion]
68
+ # Assertion error with given `message`.
69
+ def flunk(message=nil, backtrace=nil)
70
+ Assertor.assert(false, message, false, backtrace || caller)
71
+ end
72
+
73
+ end
74
+
75
+ end
76
+
77
+ # Copyright (c) 2008 Thomas Sawyer