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
data/README.rdoc DELETED
@@ -1,173 +0,0 @@
1
- = Assay
2
-
3
- {Website}[http://rubyworks.github.com/assay] /
4
- {Report Issue}[http://github.com/rubyworks/assay/issues] /
5
- {Source Code}[http://github.com/rubyworks/assay] /
6
- {Mailing List}[http://groups.google.com/group/rubyworks-mailinglist]
7
-
8
-
9
- == DESCRIPTION
10
-
11
- Assay defines assertions in the same way that Ruby defines
12
- exceptions. An assertion then is nothing more that an
13
- extended Exception class. Assay provides a complete set
14
- of these assertion classes for the most common assertion types.
15
- It also provides both TestUnit-style assertion methods and
16
- RSpec-compatiable matchers built from these assertion classes
17
- for use in your preferred test harness. Assay is compatible with
18
- TestUnit, MiniTest, RSpec and other test frameworks.
19
-
20
-
21
- == FEATURES
22
-
23
- * Patterned after the Ruby exception system.
24
- * Allows assertions specialized error messages.
25
- * Supports any variety of assertion "grammers".
26
- * Can be used with almost any test framework.
27
-
28
-
29
- == LIMITATIONS
30
-
31
- * Assay is Ruby 1.9+ only!
32
-
33
-
34
- == INSTALLATION
35
-
36
- To install with RubyGems simply open a console and type:
37
-
38
- $ gem install assay
39
-
40
- Site installation with the tarball can be done with Ruby Setup
41
- (gem install setup). See http://rubyworks.github.com/setup.
42
-
43
-
44
- == UTILIZATION
45
-
46
- === Assay Classes
47
-
48
- Assay consists of a set of Assertion subclasses known as *assays*. They
49
- are akin to Ruby's Exception subclasses, indeed the +Assertion+ base class
50
- is a subclass of Exception. But assays have special class methods that are
51
- used to make assertions.
52
-
53
- Consider the +EqualityAssay+ class. It defines methods for asserting equality
54
- via the `#==` method.
55
-
56
- EqualityAssay.assert!(1,1)
57
-
58
- Additionally, we can check the assertion's test without actually raising the
59
- assertion if it fails using the query method.
60
-
61
- EqualityAssay.pass?(1,1) #=> true
62
-
63
- Assays also provide the opposite method `#refute!` along with `#fail?`.
64
-
65
- EqualityAssay.refute!(1,2)
66
-
67
- EqualityAssay.fail?(1,2) #=> true
68
-
69
- Assay instances are test matchers, which can be conveniently defined with `#[]`.
70
-
71
- EqualityAssay[1] =~ 1
72
-
73
- Notice in the example we have used `#=~` to apply the matcher which makes
74
- the `#assert!` call to the Assay object. Likewise `#!~` can be used to
75
- call `#refute!` instead. And note that `#===` is also an alias for `#=~`.
76
-
77
- EqualityAssay[1] === 1
78
-
79
- Which means assay matchers can be used in case statments.
80
-
81
- case 10
82
- when InstanceAssay[Fixnum]
83
- when EqualityAssay[10.0]
84
- end
85
-
86
- Pretty neat.
87
-
88
- === Framework Adapters
89
-
90
- Assay follows a standard practice of defining assertion error classes with
91
- an `#assertion?` method that returns +true+. This can be used by any test
92
- framework to easily detect when a raised error is an assertion rather than
93
- an ordinary error. To add support for this to common test frameworks Assay
94
- provides adapters.
95
-
96
- For example, to use assay with MiniTest framework add to your test helper
97
- script:
98
-
99
- require 'assay/adapter/minitest'
100
-
101
- Likewise for TestUnit.
102
-
103
- require 'assay/adapter/testunit'
104
-
105
- An RSpec adadpter is in the works, and should be out with the next release.
106
-
107
- Note that even without the adapter, you can still use Assay with other test
108
- frameworks. They will simply count Assay's assertions as regular errors.
109
-
110
- === Customized Grammars
111
-
112
- Of course the classes are interesting and clearly make for a sound foundation,
113
- but in the end we want to write assertions more easily and concisely. For this
114
- we turn to separate "grammar" projects that depend on Assay's classes. The
115
- first of these, created as a spin-off project to demonstrate Assay's prowess,
116
- is {Fluidity}[http://rubyworks.github.com/fluidity]. Here is a quick taste of
117
- that gem's functionality.
118
-
119
- require 'fluidity'
120
-
121
- 10.should.be.kind_of(Integer)
122
-
123
- But is you are acustom to MiniTest's spec methods, you might prefer `must`.
124
-
125
- 10.must.be.kind_of(Integer)
126
-
127
- And to satisfy all those technical aficionados (like yours truly) there is `assert`.
128
-
129
- 10.assert.kind_of(Integer)
130
-
131
- Thre are also compatibility grammar projects available, spun-off from Assay, that
132
- provide compatability with legacy test frameworks which can serve as transition
133
- to Assay from these other frameworks. Follow the links below for each:
134
-
135
- * {Assay TestUnit}[http://github.com/rubyworks/assay-testunit]
136
- * {Assay MiniTest}[http://github.com/rubyworks/assay-minitest]
137
- * {Assay RSpec}[http://github.com/rubyworks/assay-rspec]
138
-
139
- Usage is essentially the same for any one of them. For example,
140
-
141
- require 'assay/rspec'
142
-
143
- include Assay::Matchers
144
-
145
- 10.should be_kind_of(Integer)
146
-
147
- Note that the compatibility modules are not yet 100% compatable, lacking some
148
- of the more esoteric and complex features. But they are very nearly so, and
149
- will become more so in time.
150
-
151
- These are just a few possible grammars. There is no reason not to build
152
- your own grammar on top of Assay's classes if you have another approach in mind.
153
- Indeed, please do! That, after all, is the main purpose of having such
154
- a set of reusable assertion classes!
155
-
156
- === Learning More
157
-
158
- There's more learn about Assay, mainly the variety of assay classes available,
159
- but also a few other bits of functionality not comvered here. To learn
160
- about these check out the {QED documentation}[http://github.com/rubyworks/assay]
161
- which provides an overiew of functionality with working examples, and the
162
- the {API documentation}[http://rubydoc.info/gems/asasy] for a more in depth look
163
- under the hood.
164
-
165
-
166
- == COPYRIGHTS
167
-
168
- Copyright (c) 2009 Rubyworks
169
-
170
- This program is ditributed under the terms of the *BSD-2-Cluase* license.
171
-
172
- See COPYING.rdoc file for details.
173
-
data/lib/assay.yml DELETED
@@ -1,51 +0,0 @@
1
- ---
2
- source:
3
- - meta
4
- authors:
5
- - name: Thomas Sawyer
6
- email: transfire@gmail.com
7
- copyrights:
8
- - holder: Thomas Sawyer
9
- year: '2009'
10
- license: BSD-2-Clause
11
- replacements: []
12
- alternatives: []
13
- requirements:
14
- - name: ansi
15
- - name: brass
16
- - name: detroit
17
- groups:
18
- - build
19
- development: true
20
- - name: qed
21
- groups:
22
- - test
23
- development: true
24
- dependencies: []
25
- conflicts: []
26
- repositories:
27
- - uri: git@github.com:rubyworks/assay.git
28
- scm: git
29
- name: upstream
30
- resources:
31
- home: http://rubyworks.github.com/assay
32
- docs: http://rubydoc.info/gems/assay/frames
33
- code: http://github.com/rubyworks/assay
34
- bugs: http://github.com/rubyworks/assay/issues
35
- mail: http://groups.google.com/groups/rubyworks-mailinglist
36
- extra: {}
37
- load_path:
38
- - lib
39
- revision: 0
40
- created: '2009-08-21'
41
- summary: Class-based Assertions Framework
42
- title: Assay
43
- version: 0.4.1
44
- name: assay
45
- description: ! 'Assay defines assertions in the same way that Ruby defines exceptions.
46
-
47
- Each type of asserition, called an assay, is then a child of the base
48
-
49
- Assertion class, which itself is a subclass of the Exception class.'
50
- organization: Rubyworks
51
- date: '2012-01-27'
@@ -1,59 +0,0 @@
1
- covers 'assay/compare_assay'
2
-
3
- testcase CompareAssay do
4
-
5
- class_method :pass? do
6
-
7
- test do
8
- assert CompareAssay.pass?(1, 1, 0)
9
- assert CompareAssay.pass?(1, 2, -1)
10
- assert CompareAssay.pass?(2, 1, 1)
11
-
12
- refute CompareAssay.pass?(1, 1, 1)
13
- refute CompareAssay.pass?(1, 1, -1)
14
- end
15
-
16
- end
17
-
18
- class_method :fail? do
19
-
20
- test do
21
- assert CompareAssay.fail?(1, 1, 1)
22
- assert CompareAssay.fail?(1, 1, -1)
23
-
24
- refute CompareAssay.fail?(1, 1, 0)
25
- refute CompareAssay.fail?(1, 2, -1)
26
- refute CompareAssay.fail?(2, 1, 1)
27
- end
28
-
29
- end
30
-
31
- class_method :assert! do
32
-
33
- test do
34
- CompareAssay.assert!(1, 1, 0)
35
- end
36
-
37
- test do
38
- expect CompareAssay do
39
- CompareAssay.assert!(1, 1, 1)
40
- end
41
- end
42
-
43
- end
44
-
45
- class_method :refute! do
46
-
47
- test do
48
- CompareAssay.refute!(1, 2, 0)
49
- end
50
-
51
- test do
52
- expect CompareAssay do
53
- CompareAssay.refute!(1, 1, 0)
54
- end
55
- end
56
-
57
- end
58
-
59
- end
@@ -1,51 +0,0 @@
1
- covers 'assay/empty_assay'
2
-
3
- testcase EmptyAssay do
4
-
5
- class_method :pass? do
6
-
7
- test do
8
- assert EmptyAssay.pass?([])
9
- refute EmptyAssay.pass?([1])
10
- end
11
-
12
- end
13
-
14
- class_method :fail? do
15
-
16
- test do
17
- refute EmptyAssay.fail?([])
18
- assert EmptyAssay.fail?([1])
19
- end
20
-
21
- end
22
-
23
- class_method :assert! do
24
-
25
- test do
26
- EmptyAssay.assert!([])
27
- end
28
-
29
- test do
30
- expect EmptyAssay do
31
- EmptyAssay.assert!([1])
32
- end
33
- end
34
-
35
- end
36
-
37
- class_method :refute! do
38
-
39
- test do
40
- EmptyAssay.refute!([1])
41
- end
42
-
43
- test do
44
- expect EmptyAssay do
45
- EmptyAssay.refute!([])
46
- end
47
- end
48
-
49
- end
50
-
51
- end
@@ -1,53 +0,0 @@
1
- covers 'assay/equal_assay'
2
-
3
- testcase EqualAssay do
4
-
5
- class_method :pass? do
6
-
7
- test do
8
- assert EqualAssay.pass?(1, 1)
9
- assert EqualAssay.pass?(1, 1.0)
10
- refute EqualAssay.pass?(1, 2)
11
- end
12
-
13
- end
14
-
15
- class_method :fail? do
16
-
17
- test do
18
- refute EqualAssay.fail?(1, 1)
19
- refute EqualAssay.fail?(1, 1.0)
20
- assert EqualAssay.fail?(1, 2)
21
- end
22
-
23
- end
24
-
25
- class_method :assert! do
26
-
27
- test do
28
- EqualAssay.assert!(1, 1)
29
- end
30
-
31
- test do
32
- expect EqualAssay do
33
- EqualAssay.assert!(1, 2)
34
- end
35
- end
36
-
37
- end
38
-
39
- class_method :refute! do
40
-
41
- test do
42
- EqualAssay.refute!(1, 2)
43
- end
44
-
45
- test do
46
- expect EqualAssay do
47
- EqualAssay.refute!(1, 1)
48
- end
49
- end
50
-
51
- end
52
-
53
- end
@@ -1,55 +0,0 @@
1
- covers 'assay/equality_assay'
2
-
3
- testcase EqualityAssay do
4
-
5
- class_method :pass? do
6
-
7
- test do
8
- assert EqualityAssay.pass?(1, 1)
9
-
10
- refute EqualityAssay.pass?(1, 1.0)
11
- refute EqualityAssay.pass?(1, 2)
12
- end
13
-
14
- end
15
-
16
- class_method :fail? do
17
-
18
- test do
19
- refute EqualityAssay.fail?(1, 1)
20
-
21
- assert EqualityAssay.fail?(1, 1.0)
22
- assert EqualityAssay.fail?(1, 2)
23
- end
24
-
25
- end
26
-
27
- class_method :assert! do
28
-
29
- test do
30
- EqualityAssay.assert!(1, 1)
31
- end
32
-
33
- test do
34
- expect EqualityAssay do
35
- EqualityAssay.assert!(1, 2)
36
- end
37
- end
38
-
39
- end
40
-
41
- class_method :refute! do
42
-
43
- test do
44
- EqualityAssay.refute!(1, 1.0)
45
- end
46
-
47
- test do
48
- expect EqualityAssay do
49
- EqualityAssay.refute!(1, 1)
50
- end
51
- end
52
-
53
- end
54
-
55
- end
@@ -1,48 +0,0 @@
1
- covers 'assay/false_assay'
2
-
3
- testcase FalseAssay do
4
-
5
- class_method :pass? do
6
- test do
7
- assert FalseAssay.pass?(false)
8
- refute FalseAssay.pass?(true)
9
- refute FalseAssay.pass?(nil)
10
- refute FalseAssay.pass?(:foobar)
11
- end
12
- end
13
-
14
- class_method :fail? do
15
- test do
16
- refute FalseAssay.fail?(false)
17
- assert FalseAssay.fail?(true)
18
- assert FalseAssay.fail?(nil)
19
- assert FalseAssay.fail?(:foobar)
20
- end
21
- end
22
-
23
- class_method :assert! do
24
- test do
25
- FalseAssay.assert!(false)
26
- end
27
-
28
- test do
29
- expect FalseAssay do
30
- FalseAssay.assert!(nil)
31
- end
32
- end
33
- end
34
-
35
- class_method :refute! do
36
- test do
37
- FalseAssay.refute!(true)
38
- FalseAssay.refute!(nil)
39
- end
40
-
41
- test do
42
- expect FalseAssay do
43
- FalseAssay.refute!(false)
44
- end
45
- end
46
- end
47
-
48
- end
@@ -1,51 +0,0 @@
1
- covers 'assay/identity_assay'
2
-
3
- testcase IdentityAssay do
4
-
5
- class_method :pass? do
6
-
7
- test do
8
- assert IdentityAssay.pass?(1,1)
9
- refute IdentityAssay.pass?(1,2)
10
- end
11
-
12
- end
13
-
14
- class_method :fail? do
15
-
16
- test do
17
- refute IdentityAssay.fail?(1,1)
18
- assert IdentityAssay.fail?(1,2)
19
- end
20
-
21
- end
22
-
23
- class_method :assert! do
24
-
25
- test do
26
- IdentityAssay.assert!(1,1)
27
- end
28
-
29
- test do
30
- expect IdentityAssay do
31
- IdentityAssay.assert!(1,2)
32
- end
33
- end
34
-
35
- end
36
-
37
- class_method :refute! do
38
-
39
- test do
40
- IdentityAssay.refute!(1,2)
41
- end
42
-
43
- test do
44
- expect IdentityAssay do
45
- IdentityAssay.refute!(1,1)
46
- end
47
- end
48
-
49
- end
50
-
51
- end
@@ -1,51 +0,0 @@
1
- covers 'assay/include_assay'
2
-
3
- testcase IncludeAssay do
4
-
5
- class_method :pass? do
6
-
7
- test do
8
- assert IncludeAssay.pass?([1], 1)
9
- refute IncludeAssay.pass?([1], 2)
10
- end
11
-
12
- end
13
-
14
- class_method :fail? do
15
-
16
- test do
17
- refute IncludeAssay.fail?([1], 1)
18
- assert IncludeAssay.fail?([1], 2)
19
- end
20
-
21
- end
22
-
23
- class_method :assert! do
24
-
25
- test do
26
- IncludeAssay.assert!([1], 1)
27
- end
28
-
29
- test do
30
- expect IncludeAssay do
31
- IncludeAssay.assert!([1], 2)
32
- end
33
- end
34
-
35
- end
36
-
37
- class_method :refute! do
38
-
39
- test do
40
- IncludeAssay.refute!([1], 2)
41
- end
42
-
43
- test do
44
- expect IncludeAssay do
45
- IncludeAssay.refute!([1], 1)
46
- end
47
- end
48
-
49
- end
50
-
51
- end
@@ -1,51 +0,0 @@
1
- covers 'assay/instance_assay'
2
-
3
- testcase InstanceAssay do
4
-
5
- class_method :pass? do
6
-
7
- test do
8
- assert InstanceAssay.pass?(1,Fixnum)
9
- refute InstanceAssay.pass?(1,Integer)
10
- end
11
-
12
- end
13
-
14
- class_method :fail? do
15
-
16
- test do
17
- refute InstanceAssay.fail?(1,Fixnum)
18
- assert InstanceAssay.fail?(1,String)
19
- end
20
-
21
- end
22
-
23
- class_method :assert! do
24
-
25
- test do
26
- InstanceAssay.assert!(1,Fixnum)
27
- end
28
-
29
- test do
30
- expect InstanceAssay do
31
- InstanceAssay.assert!(1,Symbol)
32
- end
33
- end
34
-
35
- end
36
-
37
- class_method :refute! do
38
-
39
- test do
40
- InstanceAssay.refute!(1,Numeric)
41
- end
42
-
43
- test do
44
- expect InstanceAssay do
45
- InstanceAssay.refute!(1,Fixnum)
46
- end
47
- end
48
-
49
- end
50
-
51
- end
@@ -1,51 +0,0 @@
1
- covers 'assay/kind_assay'
2
-
3
- testcase KindAssay do
4
-
5
- class_method :pass? do
6
-
7
- test do
8
- assert KindAssay.pass?(1,Integer)
9
- refute KindAssay.pass?(1,String)
10
- end
11
-
12
- end
13
-
14
- class_method :fail? do
15
-
16
- test do
17
- refute KindAssay.fail?(1,Integer)
18
- assert KindAssay.fail?(1,String)
19
- end
20
-
21
- end
22
-
23
- class_method :assert! do
24
-
25
- test do
26
- KindAssay.assert!(1,Fixnum)
27
- end
28
-
29
- test do
30
- expect KindAssay do
31
- KindAssay.assert!(1,Symbol)
32
- end
33
- end
34
-
35
- end
36
-
37
- class_method :refute! do
38
-
39
- test do
40
- KindAssay.refute!(1,String)
41
- end
42
-
43
- test do
44
- expect KindAssay do
45
- KindAssay.refute!(1,Numeric)
46
- end
47
- end
48
-
49
- end
50
-
51
- end