veritas 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (660) hide show
  1. data/.gemtest +0 -0
  2. data/.rvmrc +1 -0
  3. data/.travis.yml +8 -0
  4. data/Gemfile +20 -10
  5. data/Guardfile +22 -0
  6. data/README.rdoc +5 -6
  7. data/Rakefile +4 -2
  8. data/TODO +18 -23
  9. data/config/flay.yml +1 -1
  10. data/config/flog.yml +1 -1
  11. data/config/roodi.yml +1 -1
  12. data/config/site.reek +3 -3
  13. data/lib/veritas/aggregate/count.rb +55 -0
  14. data/lib/veritas/aggregate/maximum.rb +59 -0
  15. data/lib/veritas/aggregate/mean.rb +81 -0
  16. data/lib/veritas/aggregate/minimum.rb +59 -0
  17. data/lib/veritas/aggregate/standard_deviation.rb +58 -0
  18. data/lib/veritas/aggregate/sum.rb +81 -0
  19. data/lib/veritas/aggregate/variance.rb +81 -0
  20. data/lib/veritas/aggregate.rb +116 -0
  21. data/lib/veritas/algebra/difference.rb +3 -1
  22. data/lib/veritas/algebra/extension.rb +12 -10
  23. data/lib/veritas/algebra/intersection.rb +3 -1
  24. data/lib/veritas/algebra/join.rb +17 -15
  25. data/lib/veritas/algebra/product.rb +4 -2
  26. data/lib/veritas/algebra/projection.rb +4 -3
  27. data/lib/veritas/algebra/rename/aliases.rb +6 -4
  28. data/lib/veritas/algebra/rename.rb +12 -3
  29. data/lib/veritas/algebra/restriction.rb +13 -12
  30. data/lib/veritas/algebra/summarization/summaries.rb +59 -0
  31. data/lib/veritas/algebra/summarization/summary.rb +83 -0
  32. data/lib/veritas/algebra/summarization.rb +88 -75
  33. data/lib/veritas/algebra/union.rb +4 -2
  34. data/lib/veritas/attribute/boolean.rb +5 -3
  35. data/lib/veritas/attribute/class.rb +2 -0
  36. data/lib/veritas/attribute/comparable.rb +11 -5
  37. data/lib/veritas/attribute/date.rb +2 -0
  38. data/lib/veritas/attribute/date_time.rb +2 -0
  39. data/lib/veritas/attribute/decimal.rb +2 -0
  40. data/lib/veritas/attribute/float.rb +4 -0
  41. data/lib/veritas/attribute/integer.rb +2 -0
  42. data/lib/veritas/attribute/numeric.rb +6 -4
  43. data/lib/veritas/attribute/object.rb +7 -4
  44. data/lib/veritas/attribute/orderable.rb +2 -0
  45. data/lib/veritas/attribute/string.rb +39 -13
  46. data/lib/veritas/attribute/time.rb +2 -0
  47. data/lib/veritas/attribute.rb +92 -36
  48. data/lib/veritas/core_ext/date.rb +2 -0
  49. data/lib/veritas/core_ext/range.rb +2 -0
  50. data/lib/veritas/core_ext/time.rb +2 -0
  51. data/lib/veritas/function/binary.rb +107 -0
  52. data/lib/veritas/function/comparable.rb +55 -0
  53. data/lib/veritas/{logic → function}/connective/conjunction.rb +24 -6
  54. data/lib/veritas/{logic → function}/connective/disjunction.rb +24 -6
  55. data/lib/veritas/{logic → function}/connective/negation.rb +34 -13
  56. data/lib/veritas/function/connective.rb +21 -0
  57. data/lib/veritas/function/numeric/absolute.rb +62 -0
  58. data/lib/veritas/function/numeric/addition.rb +62 -0
  59. data/lib/veritas/function/numeric/binary.rb +26 -0
  60. data/lib/veritas/function/numeric/division.rb +71 -0
  61. data/lib/veritas/function/numeric/exponentiation.rb +68 -0
  62. data/lib/veritas/function/numeric/modulo.rb +53 -0
  63. data/lib/veritas/function/numeric/multiplication.rb +62 -0
  64. data/lib/veritas/function/numeric/square_root.rb +86 -0
  65. data/lib/veritas/function/numeric/subtraction.rb +62 -0
  66. data/lib/veritas/function/numeric/unary.rb +23 -0
  67. data/lib/veritas/function/numeric/unary_minus.rb +74 -0
  68. data/lib/veritas/function/numeric/unary_plus.rb +76 -0
  69. data/lib/veritas/function/numeric.rb +11 -0
  70. data/lib/veritas/{logic → function}/predicate/enumerable.rb +4 -2
  71. data/lib/veritas/{logic → function}/predicate/equality.rb +5 -3
  72. data/lib/veritas/{logic → function}/predicate/exclusion.rb +5 -5
  73. data/lib/veritas/{logic → function}/predicate/greater_than.rb +5 -3
  74. data/lib/veritas/{logic → function}/predicate/greater_than_or_equal_to.rb +5 -3
  75. data/lib/veritas/{logic → function}/predicate/inclusion.rb +5 -5
  76. data/lib/veritas/{logic → function}/predicate/inequality.rb +4 -2
  77. data/lib/veritas/{logic → function}/predicate/less_than.rb +5 -3
  78. data/lib/veritas/{logic → function}/predicate/less_than_or_equal_to.rb +5 -3
  79. data/lib/veritas/{logic → function}/predicate/match.rb +17 -3
  80. data/lib/veritas/{logic → function}/predicate/no_match.rb +5 -3
  81. data/lib/veritas/function/predicate.rb +26 -0
  82. data/lib/veritas/{logic → function}/proposition/contradiction.rb +7 -4
  83. data/lib/veritas/{logic → function}/proposition/tautology.rb +7 -4
  84. data/lib/veritas/{logic → function}/proposition.rb +29 -4
  85. data/lib/veritas/function/string/length.rb +68 -0
  86. data/lib/veritas/{logic/connective → function}/unary.rb +48 -12
  87. data/lib/veritas/function.rb +128 -0
  88. data/lib/veritas/relation/base.rb +38 -0
  89. data/lib/veritas/relation/empty.rb +2 -0
  90. data/lib/veritas/relation/header.rb +14 -37
  91. data/lib/veritas/relation/materialized.rb +9 -0
  92. data/lib/veritas/relation/operation/binary.rb +3 -2
  93. data/lib/veritas/relation/operation/combination.rb +2 -0
  94. data/lib/veritas/relation/operation/limit.rb +11 -1
  95. data/lib/veritas/relation/operation/offset.rb +11 -1
  96. data/lib/veritas/relation/operation/order/direction.rb +2 -0
  97. data/lib/veritas/relation/operation/order/direction_set.rb +5 -3
  98. data/lib/veritas/relation/operation/order.rb +15 -7
  99. data/lib/veritas/relation/operation/reverse.rb +4 -2
  100. data/lib/veritas/relation/operation/set.rb +2 -0
  101. data/lib/veritas/relation/operation/unary.rb +3 -2
  102. data/lib/veritas/relation.rb +9 -6
  103. data/lib/veritas/support/abstract_class.rb +2 -0
  104. data/lib/veritas/support/aliasable.rb +2 -0
  105. data/lib/veritas/support/evaluator.rb +37 -16
  106. data/lib/veritas/support/immutable.rb +5 -5
  107. data/lib/veritas/support/operation/binary.rb +2 -0
  108. data/lib/veritas/support/operation/unary.rb +2 -0
  109. data/lib/veritas/support/visitable.rb +2 -0
  110. data/lib/veritas/tuple.rb +13 -9
  111. data/lib/veritas/version.rb +3 -1
  112. data/lib/veritas.rb +60 -25
  113. data/spec/integration/veritas/algebra/join_spec.rb +2 -0
  114. data/spec/integration/veritas/algebra/product_spec.rb +2 -0
  115. data/spec/integration/veritas/algebra/projection_spec.rb +2 -0
  116. data/spec/integration/veritas/algebra/summarization_spec.rb +9 -9
  117. data/spec/integration/veritas/relation/efficient_enumerable_spec.rb +2 -0
  118. data/spec/shared/command_method_behavior.rb +2 -0
  119. data/spec/shared/each_method_behaviour.rb +2 -0
  120. data/spec/shared/hash_method_behavior.rb +2 -0
  121. data/spec/shared/idempotent_method_behavior.rb +2 -0
  122. data/spec/spec_helper.rb +13 -0
  123. data/spec/unit/date/pred_spec.rb +2 -0
  124. data/spec/unit/range/overlaps_spec.rb +2 -0
  125. data/spec/unit/range/to_inclusive_spec.rb +2 -0
  126. data/spec/unit/time/pred_spec.rb +2 -0
  127. data/spec/unit/veritas/abstract_class/class_methods/new_spec.rb +2 -0
  128. data/spec/unit/veritas/aggregate/call_spec.rb +43 -0
  129. data/spec/unit/veritas/{logic/proposition → aggregate}/class_methods/call_spec.rb +3 -1
  130. data/spec/unit/veritas/aggregate/class_methods/default_spec.rb +11 -0
  131. data/spec/unit/veritas/aggregate/class_methods/finalize_spec.rb +12 -0
  132. data/spec/unit/veritas/aggregate/count/class_methods/call_spec.rb +30 -0
  133. data/spec/unit/veritas/aggregate/count/class_methods/default_spec.rb +13 -0
  134. data/spec/unit/veritas/aggregate/count/methods/count_spec.rb +14 -0
  135. data/spec/unit/veritas/aggregate/count/type_spec.rb +12 -0
  136. data/spec/unit/veritas/aggregate/default_spec.rb +17 -0
  137. data/spec/unit/veritas/aggregate/finalize_spec.rb +18 -0
  138. data/spec/unit/veritas/aggregate/maximum/class_methods/call_spec.rb +36 -0
  139. data/spec/unit/veritas/aggregate/maximum/class_methods/default_spec.rb +13 -0
  140. data/spec/unit/veritas/aggregate/maximum/methods/maximum_spec.rb +16 -0
  141. data/spec/unit/veritas/aggregate/maximum/type_spec.rb +20 -0
  142. data/spec/unit/veritas/aggregate/mean/class_methods/call_spec.rb +30 -0
  143. data/spec/unit/veritas/aggregate/mean/class_methods/default_spec.rb +15 -0
  144. data/spec/unit/veritas/aggregate/mean/class_methods/finalize_spec.rb +16 -0
  145. data/spec/unit/veritas/aggregate/mean/methods/mean_spec.rb +16 -0
  146. data/spec/unit/veritas/aggregate/mean/type_spec.rb +12 -0
  147. data/spec/unit/veritas/aggregate/minimum/class_methods/call_spec.rb +36 -0
  148. data/spec/unit/veritas/aggregate/minimum/class_methods/default_spec.rb +13 -0
  149. data/spec/unit/veritas/aggregate/minimum/methods/minimum_spec.rb +16 -0
  150. data/spec/unit/veritas/aggregate/minimum/type_spec.rb +20 -0
  151. data/spec/unit/veritas/aggregate/standard_deviation/class_methods/finalize_spec.rb +34 -0
  152. data/spec/unit/veritas/aggregate/standard_deviation/methods/standard_deviation_spec.rb +16 -0
  153. data/spec/unit/veritas/aggregate/standard_deviation/type_spec.rb +12 -0
  154. data/spec/unit/veritas/aggregate/sum/class_methods/call_spec.rb +30 -0
  155. data/spec/unit/veritas/aggregate/sum/class_methods/default_spec.rb +13 -0
  156. data/spec/unit/veritas/aggregate/sum/default_spec.rb +27 -0
  157. data/spec/unit/veritas/aggregate/sum/methods/sum_spec.rb +14 -0
  158. data/spec/unit/veritas/aggregate/sum/type_spec.rb +20 -0
  159. data/spec/unit/veritas/aggregate/type_spec.rb +13 -0
  160. data/spec/unit/veritas/aggregate/variance/class_methods/call_spec.rb +30 -0
  161. data/spec/unit/veritas/aggregate/variance/class_methods/default_spec.rb +15 -0
  162. data/spec/unit/veritas/aggregate/variance/class_methods/finalize_spec.rb +26 -0
  163. data/spec/unit/veritas/aggregate/variance/methods/variance_spec.rb +16 -0
  164. data/spec/unit/veritas/aggregate/variance/type_spec.rb +12 -0
  165. data/spec/unit/veritas/algebra/difference/each_spec.rb +2 -0
  166. data/spec/unit/veritas/algebra/difference/methods/difference_spec.rb +2 -0
  167. data/spec/unit/veritas/algebra/extension/class_methods/new_spec.rb +2 -0
  168. data/spec/unit/veritas/algebra/extension/each_spec.rb +2 -0
  169. data/spec/unit/veritas/algebra/extension/eql_spec.rb +2 -0
  170. data/spec/unit/veritas/algebra/extension/extensions_spec.rb +2 -0
  171. data/spec/unit/veritas/algebra/extension/hash_spec.rb +2 -0
  172. data/spec/unit/veritas/algebra/extension/header_spec.rb +2 -0
  173. data/spec/unit/veritas/algebra/extension/methods/extend_spec.rb +2 -0
  174. data/spec/unit/veritas/algebra/extension/operand_spec.rb +2 -0
  175. data/spec/unit/veritas/algebra/intersection/each_spec.rb +2 -0
  176. data/spec/unit/veritas/algebra/intersection/methods/intersect_spec.rb +2 -0
  177. data/spec/unit/veritas/algebra/join/class_methods/new_spec.rb +2 -0
  178. data/spec/unit/veritas/algebra/join/each_spec.rb +2 -0
  179. data/spec/unit/veritas/algebra/join/methods/join_spec.rb +3 -14
  180. data/spec/unit/veritas/algebra/product/class_methods/new_spec.rb +2 -0
  181. data/spec/unit/veritas/algebra/product/each_spec.rb +2 -0
  182. data/spec/unit/veritas/algebra/product/methods/product_spec.rb +2 -0
  183. data/spec/unit/veritas/algebra/projection/each_spec.rb +2 -0
  184. data/spec/unit/veritas/algebra/projection/eql_spec.rb +2 -0
  185. data/spec/unit/veritas/algebra/projection/hash_spec.rb +2 -0
  186. data/spec/unit/veritas/algebra/projection/header_spec.rb +2 -0
  187. data/spec/unit/veritas/algebra/projection/methods/project_spec.rb +2 -0
  188. data/spec/unit/veritas/algebra/projection/methods/remove_spec.rb +2 -0
  189. data/spec/unit/veritas/algebra/rename/aliases/class_methods/coerce_spec.rb +2 -0
  190. data/spec/unit/veritas/algebra/rename/aliases/class_methods/new_spec.rb +2 -0
  191. data/spec/unit/veritas/algebra/rename/aliases/each_spec.rb +2 -0
  192. data/spec/unit/veritas/algebra/rename/aliases/element_reference_spec.rb +2 -0
  193. data/spec/unit/veritas/algebra/rename/aliases/empty_spec.rb +2 -0
  194. data/spec/unit/veritas/algebra/rename/aliases/eql_spec.rb +2 -0
  195. data/spec/unit/veritas/algebra/rename/aliases/equal_value_spec.rb +2 -0
  196. data/spec/unit/veritas/algebra/rename/aliases/hash_spec.rb +2 -0
  197. data/spec/unit/veritas/algebra/rename/aliases/to_hash_spec.rb +2 -0
  198. data/spec/unit/veritas/algebra/rename/aliases/union_spec.rb +2 -0
  199. data/spec/unit/veritas/algebra/rename/aliases_spec.rb +2 -0
  200. data/spec/unit/veritas/algebra/rename/directions_spec.rb +4 -2
  201. data/spec/unit/veritas/algebra/rename/each_spec.rb +2 -0
  202. data/spec/unit/veritas/algebra/rename/eql_spec.rb +2 -0
  203. data/spec/unit/veritas/algebra/rename/hash_spec.rb +2 -0
  204. data/spec/unit/veritas/algebra/rename/header_spec.rb +2 -0
  205. data/spec/unit/veritas/algebra/rename/methods/rename_spec.rb +2 -0
  206. data/spec/unit/veritas/algebra/restriction/each_spec.rb +36 -6
  207. data/spec/unit/veritas/algebra/restriction/eql_spec.rb +2 -0
  208. data/spec/unit/veritas/algebra/restriction/hash_spec.rb +2 -0
  209. data/spec/unit/veritas/algebra/restriction/methods/restrict_spec.rb +9 -26
  210. data/spec/unit/veritas/algebra/restriction/predicate_spec.rb +2 -0
  211. data/spec/unit/veritas/algebra/summarization/class_methods/new_spec.rb +30 -0
  212. data/spec/unit/veritas/algebra/summarization/each_spec.rb +2 -0
  213. data/spec/unit/veritas/algebra/summarization/eql_spec.rb +2 -0
  214. data/spec/unit/veritas/algebra/summarization/hash_spec.rb +2 -0
  215. data/spec/unit/veritas/algebra/summarization/header_spec.rb +4 -2
  216. data/spec/unit/veritas/algebra/summarization/methods/summarize_spec.rb +19 -10
  217. data/spec/unit/veritas/algebra/summarization/summaries/summarize_by_spec.rb +26 -0
  218. data/spec/unit/veritas/algebra/summarization/summaries/to_hash_spec.rb +16 -0
  219. data/spec/unit/veritas/algebra/summarization/{summarize_by_spec.rb → summarize_per_spec.rb} +6 -4
  220. data/spec/unit/veritas/algebra/summarization/summarizers_spec.rb +3 -1
  221. data/spec/unit/veritas/algebra/summarization/summary/call_spec.rb +43 -0
  222. data/spec/unit/veritas/algebra/summarization/summary/summarize_by_spec.rb +20 -0
  223. data/spec/unit/veritas/algebra/union/each_spec.rb +2 -0
  224. data/spec/unit/veritas/algebra/union/methods/union_spec.rb +2 -0
  225. data/spec/unit/veritas/aliasable/fixtures/classes.rb +2 -0
  226. data/spec/unit/veritas/aliasable/inheritable_alias_spec.rb +3 -1
  227. data/spec/unit/veritas/attribute/boolean/class_methods/primitive_spec.rb +2 -0
  228. data/spec/unit/veritas/attribute/boolean/valid_value_spec.rb +2 -0
  229. data/spec/unit/veritas/attribute/call_spec.rb +2 -0
  230. data/spec/unit/veritas/attribute/class/class_methods/primitive_spec.rb +2 -0
  231. data/spec/unit/veritas/attribute/class_methods/coerce_spec.rb +36 -0
  232. data/spec/unit/veritas/attribute/class_methods/descendants_spec.rb +27 -0
  233. data/spec/unit/veritas/attribute/class_methods/infer_type_spec.rb +121 -0
  234. data/spec/unit/veritas/attribute/class_methods/inherited_spec.rb +25 -0
  235. data/spec/unit/veritas/attribute/class_methods/name_from_spec.rb +2 -0
  236. data/spec/unit/veritas/attribute/class_methods/new_spec.rb +2 -0
  237. data/spec/unit/veritas/attribute/comparable/comparable_spec.rb +3 -3
  238. data/spec/unit/veritas/attribute/comparable/fixtures/classes.rb +2 -0
  239. data/spec/unit/veritas/attribute/date/class_methods/primitive_spec.rb +2 -0
  240. data/spec/unit/veritas/attribute/date/range_spec.rb +2 -0
  241. data/spec/unit/veritas/attribute/date_time/class_methods/primitive_spec.rb +2 -0
  242. data/spec/unit/veritas/attribute/date_time/range_spec.rb +2 -0
  243. data/spec/unit/veritas/attribute/decimal/class_methods/primitive_spec.rb +2 -0
  244. data/spec/unit/veritas/attribute/eql_spec.rb +2 -0
  245. data/spec/unit/veritas/attribute/equal_value_spec.rb +2 -0
  246. data/spec/unit/veritas/attribute/float/class_methods/primitive_spec.rb +2 -0
  247. data/spec/unit/veritas/attribute/float/size_spec.rb +21 -0
  248. data/spec/unit/veritas/attribute/hash_spec.rb +2 -0
  249. data/spec/unit/veritas/attribute/inspect_spec.rb +2 -0
  250. data/spec/unit/veritas/attribute/integer/class_methods/primitive_spec.rb +2 -0
  251. data/spec/unit/veritas/attribute/joinable_spec.rb +2 -0
  252. data/spec/unit/veritas/attribute/name_spec.rb +2 -0
  253. data/spec/unit/veritas/attribute/numeric/class_methods/primitive_spec.rb +2 -0
  254. data/spec/unit/veritas/attribute/numeric/joinable_spec.rb +2 -0
  255. data/spec/unit/veritas/attribute/numeric/size_spec.rb +4 -2
  256. data/spec/unit/veritas/attribute/numeric/valid_value_spec.rb +2 -0
  257. data/spec/unit/veritas/attribute/object/class_methods/primitive_spec.rb +2 -0
  258. data/spec/unit/veritas/attribute/options_spec.rb +2 -0
  259. data/spec/unit/veritas/attribute/orderable/asc_spec.rb +2 -0
  260. data/spec/unit/veritas/attribute/orderable/desc_spec.rb +2 -0
  261. data/spec/unit/veritas/attribute/orderable/fixtures/classes.rb +2 -0
  262. data/spec/unit/veritas/attribute/rename_spec.rb +2 -0
  263. data/spec/unit/veritas/attribute/required_spec.rb +2 -0
  264. data/spec/unit/veritas/attribute/string/class_methods/primitive_spec.rb +2 -0
  265. data/spec/unit/veritas/attribute/string/joinable_spec.rb +5 -3
  266. data/spec/unit/veritas/attribute/string/max_length_spec.rb +20 -0
  267. data/spec/unit/veritas/attribute/string/min_length_spec.rb +20 -0
  268. data/spec/unit/veritas/attribute/string/valid_value_spec.rb +3 -1
  269. data/spec/unit/veritas/attribute/time/class_methods/primitive_spec.rb +2 -0
  270. data/spec/unit/veritas/attribute/time/range_spec.rb +2 -0
  271. data/spec/unit/veritas/attribute/type_spec.rb +12 -0
  272. data/spec/unit/veritas/attribute/valid_primitive_spec.rb +2 -0
  273. data/spec/unit/veritas/attribute/valid_value_spec.rb +2 -0
  274. data/spec/unit/veritas/evaluator/context/add_spec.rb +46 -0
  275. data/spec/unit/veritas/evaluator/context/element_reference_spec.rb +14 -0
  276. data/spec/unit/veritas/evaluator/context/functions_spec.rb +16 -0
  277. data/spec/unit/veritas/{logic/connective → function}/binary/call_spec.rb +10 -8
  278. data/spec/unit/veritas/{logic/connective → function}/binary/equal_value_spec.rb +3 -1
  279. data/spec/unit/veritas/{logic/connective → function}/binary/fixtures/classes.rb +5 -1
  280. data/spec/unit/veritas/function/binary/invertible/inverse_spec.rb +39 -0
  281. data/spec/unit/veritas/{logic/connective → function}/binary/rename_spec.rb +3 -1
  282. data/spec/unit/veritas/{logic/expression → function}/class_methods/call_spec.rb +3 -1
  283. data/spec/unit/veritas/{logic/predicate → function}/class_methods/extract_value_spec.rb +3 -1
  284. data/spec/unit/veritas/function/class_methods/rename_attributes_spec.rb +29 -0
  285. data/spec/unit/veritas/{logic/predicate → function}/comparable/class_methods/call_spec.rb +3 -1
  286. data/spec/unit/veritas/{logic/predicate → function}/comparable/fixtures/classes.rb +3 -1
  287. data/spec/unit/veritas/function/comparable/inspect_spec.rb +15 -0
  288. data/spec/unit/veritas/{logic → function}/connective/conjunction/class_methods/call_spec.rb +3 -1
  289. data/spec/unit/veritas/{logic → function}/connective/conjunction/inspect_spec.rb +3 -1
  290. data/spec/unit/veritas/function/connective/conjunction/inverse_spec.rb +24 -0
  291. data/spec/unit/veritas/{logic → function}/connective/conjunction/methods/and_spec.rb +4 -2
  292. data/spec/unit/veritas/{logic → function}/connective/conjunction/methods/fixtures/classes.rb +3 -1
  293. data/spec/unit/veritas/{logic → function}/connective/disjunction/class_methods/call_spec.rb +3 -1
  294. data/spec/unit/veritas/{logic → function}/connective/disjunction/inspect_spec.rb +3 -1
  295. data/spec/unit/veritas/function/connective/disjunction/inverse_spec.rb +24 -0
  296. data/spec/unit/veritas/{logic → function}/connective/disjunction/methods/fixtures/classes.rb +3 -1
  297. data/spec/unit/veritas/{logic → function}/connective/disjunction/methods/or_spec.rb +4 -2
  298. data/spec/unit/veritas/function/connective/inspect_spec.rb +12 -0
  299. data/spec/unit/veritas/{logic → function}/connective/negation/class_methods/call_spec.rb +3 -1
  300. data/spec/unit/veritas/{logic → function}/connective/negation/inspect_spec.rb +4 -2
  301. data/spec/unit/veritas/{logic → function}/connective/negation/inverse_spec.rb +3 -1
  302. data/spec/unit/veritas/function/connective/negation/methods/fixtures/classes.rb +8 -0
  303. data/spec/unit/veritas/function/connective/negation/methods/not_spec.rb +39 -0
  304. data/spec/unit/veritas/function/connective/type_spec.rb +12 -0
  305. data/spec/unit/veritas/function/eql_spec.rb +14 -0
  306. data/spec/unit/veritas/function/equal_value_spec.rb +14 -0
  307. data/spec/unit/veritas/function/fixtures/classes.rb +6 -0
  308. data/spec/unit/veritas/{logic/expression → function}/hash_spec.rb +5 -3
  309. data/spec/unit/veritas/{logic/expression → function}/inspect_spec.rb +5 -3
  310. data/spec/unit/veritas/function/numeric/absolute/class_methods/call_spec.rb +21 -0
  311. data/spec/unit/veritas/function/numeric/absolute/inspect_spec.rb +11 -0
  312. data/spec/unit/veritas/function/numeric/absolute/methods/absolute_spec.rb +16 -0
  313. data/spec/unit/veritas/function/numeric/addition/class_methods/call_spec.rb +13 -0
  314. data/spec/unit/veritas/function/numeric/addition/class_methods/inverse_spec.rb +11 -0
  315. data/spec/unit/veritas/function/numeric/addition/class_methods/operation_spec.rb +11 -0
  316. data/spec/unit/veritas/function/numeric/addition/inspect_spec.rb +11 -0
  317. data/spec/unit/veritas/function/numeric/addition/methods/add_spec.rb +19 -0
  318. data/spec/unit/veritas/function/numeric/binary/type_spec.rb +33 -0
  319. data/spec/unit/veritas/function/numeric/division/class_methods/call_spec.rb +13 -0
  320. data/spec/unit/veritas/function/numeric/division/class_methods/inverse_spec.rb +11 -0
  321. data/spec/unit/veritas/function/numeric/division/class_methods/operation_spec.rb +11 -0
  322. data/spec/unit/veritas/function/numeric/division/inspect_spec.rb +11 -0
  323. data/spec/unit/veritas/function/numeric/division/methods/divide_spec.rb +19 -0
  324. data/spec/unit/veritas/function/numeric/division/type_spec.rb +11 -0
  325. data/spec/unit/veritas/function/numeric/exponentiation/class_methods/call_spec.rb +13 -0
  326. data/spec/unit/veritas/function/numeric/exponentiation/class_methods/operation_spec.rb +11 -0
  327. data/spec/unit/veritas/function/numeric/exponentiation/inspect_spec.rb +11 -0
  328. data/spec/unit/veritas/function/numeric/exponentiation/inverse_spec.rb +18 -0
  329. data/spec/unit/veritas/function/numeric/exponentiation/methods/exponent_spec.rb +19 -0
  330. data/spec/unit/veritas/function/numeric/modulo/class_methods/call_spec.rb +13 -0
  331. data/spec/unit/veritas/function/numeric/modulo/class_methods/operation_spec.rb +11 -0
  332. data/spec/unit/veritas/function/numeric/modulo/inspect_spec.rb +11 -0
  333. data/spec/unit/veritas/function/numeric/modulo/methods/modulo_spec.rb +19 -0
  334. data/spec/unit/veritas/function/numeric/multiplication/class_methods/call_spec.rb +13 -0
  335. data/spec/unit/veritas/function/numeric/multiplication/class_methods/inverse_spec.rb +11 -0
  336. data/spec/unit/veritas/function/numeric/multiplication/class_methods/operation_spec.rb +11 -0
  337. data/spec/unit/veritas/function/numeric/multiplication/inspect_spec.rb +11 -0
  338. data/spec/unit/veritas/function/numeric/multiplication/methods/multiply_spec.rb +19 -0
  339. data/spec/unit/veritas/function/numeric/square_root/class_methods/call_spec.rb +12 -0
  340. data/spec/unit/veritas/function/numeric/square_root/inspect_spec.rb +11 -0
  341. data/spec/unit/veritas/function/numeric/square_root/inverse_spec.rb +14 -0
  342. data/spec/unit/veritas/function/numeric/square_root/methods/square_root_spec.rb +16 -0
  343. data/spec/unit/veritas/function/numeric/square_root/type_spec.rb +11 -0
  344. data/spec/unit/veritas/function/numeric/subtraction/class_methods/call_spec.rb +13 -0
  345. data/spec/unit/veritas/function/numeric/subtraction/class_methods/inverse_spec.rb +11 -0
  346. data/spec/unit/veritas/function/numeric/subtraction/class_methods/operation_spec.rb +11 -0
  347. data/spec/unit/veritas/function/numeric/subtraction/inspect_spec.rb +11 -0
  348. data/spec/unit/veritas/function/numeric/subtraction/methods/subtract_spec.rb +19 -0
  349. data/spec/unit/veritas/function/numeric/unary/type_spec.rb +21 -0
  350. data/spec/unit/veritas/function/numeric/unary_minus/class_methods/call_spec.rb +21 -0
  351. data/spec/unit/veritas/function/numeric/unary_minus/class_methods/inverse_spec.rb +11 -0
  352. data/spec/unit/veritas/function/numeric/unary_minus/inspect_spec.rb +11 -0
  353. data/spec/unit/veritas/function/numeric/unary_minus/methods/unary_minus_spec.rb +16 -0
  354. data/spec/unit/veritas/function/numeric/unary_plus/class_methods/call_spec.rb +21 -0
  355. data/spec/unit/veritas/function/numeric/unary_plus/class_methods/inverse_spec.rb +11 -0
  356. data/spec/unit/veritas/function/numeric/unary_plus/inspect_spec.rb +11 -0
  357. data/spec/unit/veritas/function/numeric/unary_plus/methods/unary_plus_spec.rb +16 -0
  358. data/spec/unit/veritas/{logic → function}/predicate/call_spec.rb +3 -1
  359. data/spec/unit/veritas/{logic → function}/predicate/class_methods/call_spec.rb +3 -1
  360. data/spec/unit/veritas/{logic → function}/predicate/enumerable/class_methods/compare_method_spec.rb +3 -1
  361. data/spec/unit/veritas/{logic → function}/predicate/eql_spec.rb +3 -1
  362. data/spec/unit/veritas/{logic/predicate/inequality → function/predicate/equality}/class_methods/call_spec.rb +5 -3
  363. data/spec/unit/veritas/function/predicate/equality/class_methods/inverse_spec.rb +11 -0
  364. data/spec/unit/veritas/{logic → function}/predicate/equality/class_methods/operation_spec.rb +3 -1
  365. data/spec/unit/veritas/{logic → function}/predicate/equality/class_methods/reverse_spec.rb +3 -1
  366. data/spec/unit/veritas/{logic/predicate/greater_than_or_equal_to → function/predicate/equality}/inspect_spec.rb +4 -2
  367. data/spec/unit/veritas/{logic/predicate/greater_than → function/predicate/equality}/inverse_spec.rb +4 -2
  368. data/spec/unit/veritas/{logic → function}/predicate/equality/methods/eq_spec.rb +4 -2
  369. data/spec/unit/veritas/{logic → function}/predicate/equality/methods/fixtures/classes.rb +3 -1
  370. data/spec/unit/veritas/{logic → function}/predicate/exclusion/class_methods/call_spec.rb +3 -1
  371. data/spec/unit/veritas/function/predicate/exclusion/class_methods/inverse_spec.rb +11 -0
  372. data/spec/unit/veritas/{logic/predicate/inclusion → function/predicate/exclusion}/inspect_spec.rb +2 -2
  373. data/spec/unit/veritas/{logic/predicate/inclusion → function/predicate/exclusion}/inverse_spec.rb +4 -2
  374. data/spec/unit/veritas/{logic → function}/predicate/exclusion/methods/exclude_spec.rb +4 -2
  375. data/spec/unit/veritas/{logic → function}/predicate/exclusion/methods/fixtures/classes.rb +3 -1
  376. data/spec/unit/veritas/{logic → function}/predicate/fixtures/classes.rb +3 -1
  377. data/spec/unit/veritas/{logic → function}/predicate/greater_than/class_methods/call_spec.rb +3 -1
  378. data/spec/unit/veritas/function/predicate/greater_than/class_methods/inverse_spec.rb +11 -0
  379. data/spec/unit/veritas/{logic → function}/predicate/greater_than/class_methods/operation_spec.rb +3 -1
  380. data/spec/unit/veritas/function/predicate/greater_than/class_methods/reverse_spec.rb +11 -0
  381. data/spec/unit/veritas/{logic/predicate/equality → function/predicate/greater_than}/inspect_spec.rb +4 -2
  382. data/spec/unit/veritas/{logic/predicate/less_than → function/predicate/greater_than}/inverse_spec.rb +4 -2
  383. data/spec/unit/veritas/{logic → function}/predicate/greater_than/methods/fixtures/classes.rb +3 -1
  384. data/spec/unit/veritas/{logic → function}/predicate/greater_than/methods/gt_spec.rb +4 -2
  385. data/spec/unit/veritas/{logic → function}/predicate/greater_than_or_equal_to/class_methods/call_spec.rb +3 -1
  386. data/spec/unit/veritas/function/predicate/greater_than_or_equal_to/class_methods/inverse_spec.rb +11 -0
  387. data/spec/unit/veritas/{logic → function}/predicate/greater_than_or_equal_to/class_methods/operation_spec.rb +3 -1
  388. data/spec/unit/veritas/function/predicate/greater_than_or_equal_to/class_methods/reverse_spec.rb +11 -0
  389. data/spec/unit/veritas/function/predicate/greater_than_or_equal_to/inspect_spec.rb +12 -0
  390. data/spec/unit/veritas/{logic → function}/predicate/greater_than_or_equal_to/inverse_spec.rb +4 -2
  391. data/spec/unit/veritas/{logic → function}/predicate/greater_than_or_equal_to/methods/fixtures/classes.rb +3 -1
  392. data/spec/unit/veritas/{logic → function}/predicate/greater_than_or_equal_to/methods/gte_spec.rb +4 -2
  393. data/spec/unit/veritas/{logic → function}/predicate/hash_spec.rb +3 -1
  394. data/spec/unit/veritas/{logic → function}/predicate/inclusion/class_methods/call_spec.rb +3 -1
  395. data/spec/unit/veritas/function/predicate/inclusion/class_methods/inverse_spec.rb +11 -0
  396. data/spec/unit/veritas/{logic/predicate/exclusion → function/predicate/inclusion}/inspect_spec.rb +2 -2
  397. data/spec/unit/veritas/{logic/predicate/exclusion → function/predicate/inclusion}/inverse_spec.rb +4 -2
  398. data/spec/unit/veritas/{logic → function}/predicate/inclusion/methods/fixtures/classes.rb +3 -1
  399. data/spec/unit/veritas/{logic → function}/predicate/inclusion/methods/include_spec.rb +4 -2
  400. data/spec/unit/veritas/{logic/predicate/equality → function/predicate/inequality}/class_methods/call_spec.rb +5 -3
  401. data/spec/unit/veritas/function/predicate/inequality/class_methods/inverse_spec.rb +11 -0
  402. data/spec/unit/veritas/{logic → function}/predicate/inequality/class_methods/operation_spec.rb +3 -1
  403. data/spec/unit/veritas/function/predicate/inequality/class_methods/reverse_spec.rb +11 -0
  404. data/spec/unit/veritas/{logic → function}/predicate/inequality/inspect_spec.rb +4 -2
  405. data/spec/unit/veritas/{logic/predicate/equality → function/predicate/inequality}/inverse_spec.rb +4 -2
  406. data/spec/unit/veritas/{logic → function}/predicate/inequality/methods/fixtures/classes.rb +3 -1
  407. data/spec/unit/veritas/{logic → function}/predicate/inequality/methods/ne_spec.rb +4 -2
  408. data/spec/unit/veritas/{logic → function}/predicate/inspect_spec.rb +3 -1
  409. data/spec/unit/veritas/function/predicate/inverse_spec.rb +17 -0
  410. data/spec/unit/veritas/{logic → function}/predicate/less_than/class_methods/call_spec.rb +3 -1
  411. data/spec/unit/veritas/function/predicate/less_than/class_methods/inverse_spec.rb +11 -0
  412. data/spec/unit/veritas/{logic → function}/predicate/less_than/class_methods/operation_spec.rb +3 -1
  413. data/spec/unit/veritas/function/predicate/less_than/class_methods/reverse_spec.rb +11 -0
  414. data/spec/unit/veritas/{logic/predicate/greater_than → function/predicate/less_than}/inspect_spec.rb +4 -2
  415. data/spec/unit/veritas/{logic/predicate/inequality → function/predicate/less_than}/inverse_spec.rb +4 -2
  416. data/spec/unit/veritas/{logic → function}/predicate/less_than/methods/fixtures/classes.rb +3 -1
  417. data/spec/unit/veritas/{logic → function}/predicate/less_than/methods/lt_spec.rb +4 -2
  418. data/spec/unit/veritas/{logic → function}/predicate/less_than_or_equal_to/class_methods/call_spec.rb +3 -1
  419. data/spec/unit/veritas/function/predicate/less_than_or_equal_to/class_methods/inverse_spec.rb +11 -0
  420. data/spec/unit/veritas/{logic → function}/predicate/less_than_or_equal_to/class_methods/operation_spec.rb +3 -1
  421. data/spec/unit/veritas/function/predicate/less_than_or_equal_to/class_methods/reverse_spec.rb +11 -0
  422. data/spec/unit/veritas/function/predicate/less_than_or_equal_to/inspect_spec.rb +12 -0
  423. data/spec/unit/veritas/function/predicate/less_than_or_equal_to/inverse_spec.rb +22 -0
  424. data/spec/unit/veritas/{logic → function}/predicate/less_than_or_equal_to/methods/fixtures/classes.rb +3 -1
  425. data/spec/unit/veritas/{logic → function}/predicate/less_than_or_equal_to/methods/lte_spec.rb +4 -2
  426. data/spec/unit/veritas/{logic → function}/predicate/match/class_methods/call_spec.rb +3 -1
  427. data/spec/unit/veritas/function/predicate/match/class_methods/inverse_spec.rb +11 -0
  428. data/spec/unit/veritas/{logic → function}/predicate/match/class_methods/operation_spec.rb +3 -1
  429. data/spec/unit/veritas/{logic → function}/predicate/match/inspect_spec.rb +4 -2
  430. data/spec/unit/veritas/{logic → function}/predicate/match/inverse_spec.rb +4 -2
  431. data/spec/unit/veritas/{logic → function}/predicate/match/methods/fixtures/classes.rb +3 -1
  432. data/spec/unit/veritas/{logic → function}/predicate/match/methods/match_spec.rb +4 -2
  433. data/spec/unit/veritas/{logic → function}/predicate/no_match/class_methods/call_spec.rb +3 -1
  434. data/spec/unit/veritas/function/predicate/no_match/class_methods/inverse_spec.rb +11 -0
  435. data/spec/unit/veritas/{logic → function}/predicate/no_match/class_methods/operation_spec.rb +3 -1
  436. data/spec/unit/veritas/{logic → function}/predicate/no_match/inspect_spec.rb +4 -2
  437. data/spec/unit/veritas/{logic → function}/predicate/no_match/inverse_spec.rb +4 -2
  438. data/spec/unit/veritas/{logic → function}/predicate/no_match/methods/fixtures/classes.rb +3 -1
  439. data/spec/unit/veritas/{logic → function}/predicate/no_match/methods/no_match_spec.rb +4 -2
  440. data/spec/unit/veritas/function/predicate/type_spec.rb +14 -0
  441. data/spec/unit/veritas/{logic → function}/proposition/call_spec.rb +5 -3
  442. data/spec/unit/veritas/function/proposition/class_methods/call_spec.rb +11 -0
  443. data/spec/unit/veritas/{logic → function}/proposition/class_methods/new_spec.rb +5 -3
  444. data/spec/unit/veritas/{logic → function}/proposition/contradiction/and_spec.rb +3 -1
  445. data/spec/unit/veritas/{logic → function}/proposition/contradiction/class_methods/call_spec.rb +3 -1
  446. data/spec/unit/veritas/function/proposition/contradiction/class_methods/inverse_spec.rb +11 -0
  447. data/spec/unit/veritas/{logic → function}/proposition/contradiction/inspect_spec.rb +3 -1
  448. data/spec/unit/veritas/{logic → function}/proposition/contradiction/inverse_spec.rb +4 -2
  449. data/spec/unit/veritas/{logic → function}/proposition/contradiction/or_spec.rb +3 -1
  450. data/spec/unit/veritas/{logic → function}/proposition/eql_spec.rb +6 -4
  451. data/spec/unit/veritas/{logic → function}/proposition/equal_value_spec.rb +6 -4
  452. data/spec/unit/veritas/function/proposition/hash_spec.rb +14 -0
  453. data/spec/unit/veritas/function/proposition/inspect_spec.rb +16 -0
  454. data/spec/unit/veritas/{logic → function}/proposition/inverse_spec.rb +4 -2
  455. data/spec/unit/veritas/{logic/expression → function/proposition}/rename_spec.rb +4 -3
  456. data/spec/unit/veritas/{logic → function}/proposition/tautology/and_spec.rb +3 -1
  457. data/spec/unit/veritas/{logic → function}/proposition/tautology/class_methods/call_spec.rb +3 -1
  458. data/spec/unit/veritas/function/proposition/tautology/class_methods/inverse_spec.rb +11 -0
  459. data/spec/unit/veritas/{logic → function}/proposition/tautology/inspect_spec.rb +3 -1
  460. data/spec/unit/veritas/{logic → function}/proposition/tautology/inverse_spec.rb +4 -2
  461. data/spec/unit/veritas/{logic → function}/proposition/tautology/or_spec.rb +3 -1
  462. data/spec/unit/veritas/function/proposition/type_spec.rb +12 -0
  463. data/spec/unit/veritas/function/rename_spec.rb +14 -0
  464. data/spec/unit/veritas/function/string/length/class_methods/call_spec.rb +12 -0
  465. data/spec/unit/veritas/function/string/length/inspect_spec.rb +11 -0
  466. data/spec/unit/veritas/function/string/length/methods/length_spec.rb +14 -0
  467. data/spec/unit/veritas/function/string/length/type_spec.rb +11 -0
  468. data/spec/unit/veritas/function/type_spec.rb +13 -0
  469. data/spec/unit/veritas/{logic/connective → function}/unary/call_spec.rb +3 -1
  470. data/spec/unit/veritas/{logic/connective → function}/unary/equal_value_spec.rb +3 -1
  471. data/spec/unit/veritas/{logic/connective → function}/unary/fixtures/classes.rb +5 -1
  472. data/spec/unit/veritas/function/unary/invertible/inverse_spec.rb +37 -0
  473. data/spec/unit/veritas/{logic/connective → function}/unary/rename_spec.rb +4 -2
  474. data/spec/unit/veritas/immutable/class_methods/freeze_object_spec.rb +2 -0
  475. data/spec/unit/veritas/immutable/class_methods/new_spec.rb +2 -0
  476. data/spec/unit/veritas/immutable/dup_spec.rb +2 -0
  477. data/spec/unit/veritas/immutable/fixtures/classes.rb +6 -4
  478. data/spec/unit/veritas/immutable/freeze_spec.rb +2 -0
  479. data/spec/unit/veritas/immutable/memoize_spec.rb +28 -4
  480. data/spec/unit/veritas/immutable/memoized_spec.rb +2 -0
  481. data/spec/unit/veritas/immutable/memory/element_reference_spec.rb +2 -0
  482. data/spec/unit/veritas/immutable/memory/element_set_spec.rb +5 -3
  483. data/spec/unit/veritas/immutable/module_methods/included_spec.rb +2 -0
  484. data/spec/unit/veritas/immutable/module_methods/memoize_spec.rb +9 -1
  485. data/spec/unit/veritas/operation/binary/eql_spec.rb +2 -0
  486. data/spec/unit/veritas/operation/binary/hash_spec.rb +2 -0
  487. data/spec/unit/veritas/operation/binary/left_spec.rb +2 -0
  488. data/spec/unit/veritas/operation/binary/right_spec.rb +2 -0
  489. data/spec/unit/veritas/operation/unary/eql_spec.rb +2 -0
  490. data/spec/unit/veritas/operation/unary/hash_spec.rb +2 -0
  491. data/spec/unit/veritas/operation/unary/operand_spec.rb +2 -0
  492. data/spec/unit/veritas/relation/base/name_spec.rb +45 -0
  493. data/spec/unit/veritas/relation/class_methods/new_spec.rb +2 -0
  494. data/spec/unit/veritas/relation/directions_spec.rb +3 -1
  495. data/spec/unit/veritas/relation/each_spec.rb +2 -0
  496. data/spec/unit/veritas/relation/element_reference_spec.rb +2 -0
  497. data/spec/unit/veritas/relation/empty/each_spec.rb +2 -0
  498. data/spec/unit/veritas/relation/empty/empty_spec.rb +2 -0
  499. data/spec/unit/veritas/relation/empty/header_spec.rb +2 -0
  500. data/spec/unit/veritas/relation/empty_spec.rb +2 -0
  501. data/spec/unit/veritas/relation/eql_spec.rb +2 -0
  502. data/spec/unit/veritas/relation/equal_value_spec.rb +2 -0
  503. data/spec/unit/veritas/relation/hash_spec.rb +2 -0
  504. data/spec/unit/veritas/relation/header/class_methods/coerce_spec.rb +2 -0
  505. data/spec/unit/veritas/relation/header/class_methods/new_spec.rb +2 -0
  506. data/spec/unit/veritas/relation/header/difference_spec.rb +2 -0
  507. data/spec/unit/veritas/relation/header/each_spec.rb +2 -0
  508. data/spec/unit/veritas/relation/header/element_reference_spec.rb +2 -0
  509. data/spec/unit/veritas/relation/header/empty_spec.rb +2 -0
  510. data/spec/unit/veritas/relation/header/eql_spec.rb +2 -0
  511. data/spec/unit/veritas/relation/header/equal_value_spec.rb +2 -0
  512. data/spec/unit/veritas/relation/header/hash_spec.rb +5 -3
  513. data/spec/unit/veritas/relation/header/inspect_spec.rb +2 -0
  514. data/spec/unit/veritas/relation/header/intersect_spec.rb +2 -0
  515. data/spec/unit/veritas/relation/header/project_spec.rb +2 -0
  516. data/spec/unit/veritas/relation/header/rename_spec.rb +2 -0
  517. data/spec/unit/veritas/relation/header/to_ary_spec.rb +2 -0
  518. data/spec/unit/veritas/relation/header/union_spec.rb +2 -0
  519. data/spec/unit/veritas/relation/header_spec.rb +2 -0
  520. data/spec/unit/veritas/relation/materialize_spec.rb +2 -0
  521. data/spec/unit/veritas/relation/materialized/class_methods/new_spec.rb +2 -0
  522. data/spec/unit/veritas/relation/materialized/directions_spec.rb +27 -0
  523. data/spec/unit/veritas/relation/materialized/empty_spec.rb +2 -0
  524. data/spec/unit/veritas/relation/materialized/materialize_spec.rb +2 -0
  525. data/spec/unit/veritas/relation/materialized/size_spec.rb +2 -0
  526. data/spec/unit/veritas/relation/operation/binary/class_methods/new_spec.rb +2 -0
  527. data/spec/unit/veritas/relation/operation/binary/fixtures/classes.rb +2 -0
  528. data/spec/unit/veritas/relation/operation/binary/header_spec.rb +2 -0
  529. data/spec/unit/veritas/relation/operation/combination/class_methods/combine_tuples_spec.rb +2 -0
  530. data/spec/unit/veritas/relation/operation/combination/fixtures/classes.rb +2 -0
  531. data/spec/unit/veritas/relation/operation/combination/header_spec.rb +2 -0
  532. data/spec/unit/veritas/relation/operation/limit/class_methods/new_spec.rb +2 -0
  533. data/spec/unit/veritas/relation/operation/limit/directions_spec.rb +15 -0
  534. data/spec/unit/veritas/relation/operation/limit/each_spec.rb +2 -0
  535. data/spec/unit/veritas/relation/operation/limit/eql_spec.rb +2 -0
  536. data/spec/unit/veritas/relation/operation/limit/hash_spec.rb +2 -0
  537. data/spec/unit/veritas/relation/operation/limit/limit_spec.rb +2 -0
  538. data/spec/unit/veritas/relation/operation/limit/methods/first_spec.rb +2 -0
  539. data/spec/unit/veritas/relation/operation/limit/methods/last_spec.rb +2 -0
  540. data/spec/unit/veritas/relation/operation/limit/methods/take_spec.rb +2 -0
  541. data/spec/unit/veritas/relation/operation/offset/class_methods/new_spec.rb +2 -0
  542. data/spec/unit/veritas/relation/operation/offset/directions_spec.rb +15 -0
  543. data/spec/unit/veritas/relation/operation/offset/each_spec.rb +2 -0
  544. data/spec/unit/veritas/relation/operation/offset/eql_spec.rb +2 -0
  545. data/spec/unit/veritas/relation/operation/offset/hash_spec.rb +2 -0
  546. data/spec/unit/veritas/relation/operation/offset/methods/drop_spec.rb +2 -0
  547. data/spec/unit/veritas/relation/operation/offset/offset_spec.rb +2 -0
  548. data/spec/unit/veritas/relation/operation/order/ascending/class_methods/call_spec.rb +2 -0
  549. data/spec/unit/veritas/relation/operation/order/ascending/class_methods/reverse_spec.rb +2 -0
  550. data/spec/unit/veritas/relation/operation/order/ascending/reverse_spec.rb +2 -0
  551. data/spec/unit/veritas/relation/operation/order/class_methods/new_spec.rb +2 -0
  552. data/spec/unit/veritas/relation/operation/order/descending/class_methods/call_spec.rb +2 -0
  553. data/spec/unit/veritas/relation/operation/order/descending/class_methods/reverse_spec.rb +2 -0
  554. data/spec/unit/veritas/relation/operation/order/descending/reverse_spec.rb +2 -0
  555. data/spec/unit/veritas/relation/operation/order/direction/attribute_spec.rb +2 -0
  556. data/spec/unit/veritas/relation/operation/order/direction/call_spec.rb +2 -0
  557. data/spec/unit/veritas/relation/operation/order/direction/class_methods/coerce_spec.rb +2 -0
  558. data/spec/unit/veritas/relation/operation/order/direction/eql_spec.rb +2 -0
  559. data/spec/unit/veritas/relation/operation/order/direction/hash_spec.rb +2 -0
  560. data/spec/unit/veritas/relation/operation/order/direction/rename_spec.rb +2 -0
  561. data/spec/unit/veritas/relation/operation/order/direction/reverse_spec.rb +2 -0
  562. data/spec/unit/veritas/relation/operation/order/direction_set/attributes_spec.rb +2 -0
  563. data/spec/unit/veritas/relation/operation/order/direction_set/class_methods/coerce_spec.rb +2 -0
  564. data/spec/unit/veritas/relation/operation/order/direction_set/each_spec.rb +2 -0
  565. data/spec/unit/veritas/relation/operation/order/direction_set/empty_spec.rb +2 -0
  566. data/spec/unit/veritas/relation/operation/order/direction_set/eql_spec.rb +2 -0
  567. data/spec/unit/veritas/relation/operation/order/direction_set/equal_value_spec.rb +2 -0
  568. data/spec/unit/veritas/relation/operation/order/direction_set/hash_spec.rb +2 -0
  569. data/spec/unit/veritas/relation/operation/order/direction_set/project_spec.rb +2 -0
  570. data/spec/unit/veritas/relation/operation/order/direction_set/rename_spec.rb +2 -0
  571. data/spec/unit/veritas/relation/operation/order/direction_set/reverse_spec.rb +4 -0
  572. data/spec/unit/veritas/relation/operation/order/direction_set/sort_tuples_spec.rb +2 -0
  573. data/spec/unit/veritas/relation/operation/order/direction_set/to_ary_spec.rb +2 -0
  574. data/spec/unit/veritas/relation/operation/order/direction_set/union_spec.rb +2 -0
  575. data/spec/unit/veritas/relation/operation/order/directions_spec.rb +5 -3
  576. data/spec/unit/veritas/relation/operation/order/each_spec.rb +2 -0
  577. data/spec/unit/veritas/relation/operation/order/eql_spec.rb +2 -0
  578. data/spec/unit/veritas/relation/operation/order/hash_spec.rb +2 -0
  579. data/spec/unit/veritas/relation/operation/order/header_spec.rb +2 -0
  580. data/spec/unit/veritas/relation/operation/order/methods/order_spec.rb +2 -14
  581. data/spec/unit/veritas/relation/operation/reverse/class_methods/new_spec.rb +2 -0
  582. data/spec/unit/veritas/relation/operation/reverse/directions_spec.rb +17 -0
  583. data/spec/unit/veritas/relation/operation/reverse/each_spec.rb +2 -0
  584. data/spec/unit/veritas/relation/operation/reverse/methods/reverse_spec.rb +2 -0
  585. data/spec/unit/veritas/relation/operation/set/class_methods/new_spec.rb +2 -0
  586. data/spec/unit/veritas/relation/operation/set/fixtures/classes.rb +2 -0
  587. data/spec/unit/veritas/relation/operation/set/header_spec.rb +2 -0
  588. data/spec/unit/veritas/relation/operation/unary/fixtures/classes.rb +2 -0
  589. data/spec/unit/veritas/relation/operation/unary/header_spec.rb +2 -0
  590. data/spec/unit/veritas/tuple/class_methods/coerce_spec.rb +2 -0
  591. data/spec/unit/veritas/tuple/element_reference_spec.rb +2 -0
  592. data/spec/unit/veritas/tuple/eql_spec.rb +2 -0
  593. data/spec/unit/veritas/tuple/equal_value_spec.rb +2 -0
  594. data/spec/unit/veritas/tuple/extend_spec.rb +29 -4
  595. data/spec/unit/veritas/tuple/hash_spec.rb +3 -1
  596. data/spec/unit/veritas/tuple/header_spec.rb +2 -0
  597. data/spec/unit/veritas/tuple/inspect_spec.rb +2 -0
  598. data/spec/unit/veritas/tuple/join_spec.rb +2 -0
  599. data/spec/unit/veritas/tuple/project_spec.rb +2 -0
  600. data/spec/unit/veritas/tuple/to_ary_spec.rb +4 -0
  601. data/spec/unit/veritas/visitable/accept_spec.rb +2 -0
  602. data/tasks/metrics/ci.rake +7 -0
  603. data/tasks/{quality → metrics}/flay.rake +0 -0
  604. data/tasks/{quality → metrics}/flog.rake +0 -0
  605. data/tasks/{quality → metrics}/heckle.rake +25 -3
  606. data/tasks/{quality → metrics}/metric_fu.rake +3 -0
  607. data/tasks/{quality → metrics}/reek.rake +0 -0
  608. data/tasks/{quality → metrics}/roodi.rake +0 -0
  609. data/tasks/{quality → metrics}/yardstick.rake +0 -0
  610. data/tasks/spec.rake +1 -0
  611. data/veritas.gemspec +332 -580
  612. metadata +375 -584
  613. data/lib/veritas/logic/connective/binary.rb +0 -70
  614. data/lib/veritas/logic/connective.rb +0 -24
  615. data/lib/veritas/logic/expression.rb +0 -99
  616. data/lib/veritas/logic/predicate/comparable.rb +0 -57
  617. data/lib/veritas/logic/predicate.rb +0 -99
  618. data/spec/unit/veritas/algebra/projection/directions_spec.rb +0 -24
  619. data/spec/unit/veritas/algebra/summarization/class_methods/summarize_spec.rb +0 -26
  620. data/spec/unit/veritas/attribute/string/length_spec.rb +0 -20
  621. data/spec/unit/veritas/evaluator/expression/add_spec.rb +0 -21
  622. data/spec/unit/veritas/evaluator/expression/expressions_spec.rb +0 -13
  623. data/spec/unit/veritas/logic/connective/inspect_spec.rb +0 -10
  624. data/spec/unit/veritas/logic/connective/inverse_spec.rb +0 -26
  625. data/spec/unit/veritas/logic/connective/negation/methods/fixtures/classes.rb +0 -6
  626. data/spec/unit/veritas/logic/connective/negation/methods/not_spec.rb +0 -24
  627. data/spec/unit/veritas/logic/expression/eql_spec.rb +0 -12
  628. data/spec/unit/veritas/logic/expression/equal_value_spec.rb +0 -12
  629. data/spec/unit/veritas/logic/expression/fixtures/classes.rb +0 -4
  630. data/spec/unit/veritas/logic/expression/inverse_spec.rb +0 -16
  631. data/spec/unit/veritas/logic/predicate/comparable/inspect_spec.rb +0 -13
  632. data/spec/unit/veritas/logic/predicate/equal_value_spec.rb +0 -64
  633. data/spec/unit/veritas/logic/predicate/equality/class_methods/inverse_spec.rb +0 -9
  634. data/spec/unit/veritas/logic/predicate/exclusion/class_methods/inverse_spec.rb +0 -9
  635. data/spec/unit/veritas/logic/predicate/greater_than/class_methods/inverse_spec.rb +0 -9
  636. data/spec/unit/veritas/logic/predicate/greater_than/class_methods/reverse_spec.rb +0 -9
  637. data/spec/unit/veritas/logic/predicate/greater_than_or_equal_to/class_methods/inverse_spec.rb +0 -9
  638. data/spec/unit/veritas/logic/predicate/greater_than_or_equal_to/class_methods/reverse_spec.rb +0 -9
  639. data/spec/unit/veritas/logic/predicate/inclusion/class_methods/inverse_spec.rb +0 -9
  640. data/spec/unit/veritas/logic/predicate/inequality/class_methods/inverse_spec.rb +0 -9
  641. data/spec/unit/veritas/logic/predicate/inequality/class_methods/reverse_spec.rb +0 -9
  642. data/spec/unit/veritas/logic/predicate/inverse_spec.rb +0 -31
  643. data/spec/unit/veritas/logic/predicate/less_than/class_methods/inverse_spec.rb +0 -9
  644. data/spec/unit/veritas/logic/predicate/less_than/class_methods/reverse_spec.rb +0 -9
  645. data/spec/unit/veritas/logic/predicate/less_than/inspect_spec.rb +0 -10
  646. data/spec/unit/veritas/logic/predicate/less_than_or_equal_to/class_methods/inverse_spec.rb +0 -9
  647. data/spec/unit/veritas/logic/predicate/less_than_or_equal_to/class_methods/reverse_spec.rb +0 -9
  648. data/spec/unit/veritas/logic/predicate/less_than_or_equal_to/inspect_spec.rb +0 -10
  649. data/spec/unit/veritas/logic/predicate/less_than_or_equal_to/inverse_spec.rb +0 -20
  650. data/spec/unit/veritas/logic/predicate/match/class_methods/inverse_spec.rb +0 -9
  651. data/spec/unit/veritas/logic/predicate/no_match/class_methods/inverse_spec.rb +0 -9
  652. data/spec/unit/veritas/logic/predicate/rename_spec.rb +0 -45
  653. data/spec/unit/veritas/logic/proposition/contradiction/class_methods/inverse_spec.rb +0 -9
  654. data/spec/unit/veritas/logic/proposition/hash_spec.rb +0 -12
  655. data/spec/unit/veritas/logic/proposition/inspect_spec.rb +0 -14
  656. data/spec/unit/veritas/logic/proposition/tautology/class_methods/inverse_spec.rb +0 -9
  657. data/spec/unit/veritas/relation/header/index_spec.rb +0 -20
  658. data/spec/unit/veritas/relation/operation/binary/directions_spec.rb +0 -17
  659. data/spec/unit/veritas/relation/operation/unary/directions_spec.rb +0 -16
  660. data/tasks/quality/ci.rake +0 -2
@@ -1,10 +1,12 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
- describe Logic::Proposition, '#==' do
5
+ describe Function::Proposition, '#==' do
4
6
  subject { object == other }
5
7
 
6
- let(:described_class) { Class.new(Logic::Proposition) }
7
- let(:object) { described_class.new }
8
+ let(:described_class) { Class.new(Function::Proposition) }
9
+ let(:object) { described_class.new }
8
10
 
9
11
  context 'with the same object' do
10
12
  let(:other) { object }
@@ -27,7 +29,7 @@ describe Logic::Proposition, '#==' do
27
29
  end
28
30
 
29
31
  context 'with a different class' do
30
- let(:other) { Class.new(Logic::Proposition).new }
32
+ let(:other) { Class.new(Function::Proposition).new }
31
33
 
32
34
  it { should be(false) }
33
35
 
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Function::Proposition, '#hash' do
6
+ subject { object.hash }
7
+
8
+ let(:described_class) { Class.new(Function::Proposition) }
9
+ let(:object) { described_class.new }
10
+
11
+ it_should_behave_like 'a hash method'
12
+
13
+ it { should == described_class.hash }
14
+ end
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Function::Proposition, '#inspect' do
6
+ subject { object.inspect }
7
+
8
+ let(:described_class) { Class.new(Function::Proposition) }
9
+ let(:object) { described_class.new }
10
+
11
+ before do
12
+ described_class.stub!(:name).and_return('Veritas::Function::Proposition')
13
+ end
14
+
15
+ specify { expect { subject }.to raise_error(NotImplementedError, "#{described_class.name}.call must be implemented") }
16
+ end
@@ -1,9 +1,11 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
- describe Logic::Proposition, '#inverse' do
5
+ describe Function::Proposition, '#inverse' do
4
6
  subject { object.inverse }
5
7
 
6
- let(:described_class) { Class.new(Logic::Proposition) }
8
+ let(:described_class) { Class.new(Function::Proposition) }
7
9
  let(:inverse_class) { mock('Inverse Class', :instance => inverse_instance) }
8
10
  let(:inverse_instance) { mock('Inverse Instance') }
9
11
  let(:object) { described_class.new }
@@ -1,10 +1,11 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
- require File.expand_path('../fixtures/classes', __FILE__)
3
4
 
4
- describe Logic::Expression, '#rename' do
5
+ describe Function::Proposition, '#rename' do
5
6
  subject { object.rename(aliases) }
6
7
 
7
- let(:described_class) { ExpressionSpecs::Object }
8
+ let(:described_class) { Class.new(Function::Proposition) }
8
9
  let(:header) { TABLE_DUM.header }
9
10
  let(:aliases) { Algebra::Rename::Aliases.new({}) }
10
11
  let(:object) { described_class.new }
@@ -1,6 +1,8 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
- describe Logic::Proposition::Tautology, '#and' do
5
+ describe Function::Proposition::Tautology, '#and' do
4
6
  subject { object.and(other) }
5
7
 
6
8
  let(:other) { mock('other') }
@@ -1,6 +1,8 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
- describe Logic::Proposition::Tautology, '.call' do
5
+ describe Function::Proposition::Tautology, '.call' do
4
6
  subject { object.call }
5
7
 
6
8
  let(:object) { described_class }
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Function::Proposition::Tautology, '.inverse' do
6
+ subject { object.inverse }
7
+
8
+ let(:object) { described_class }
9
+
10
+ it { should equal(Function::Proposition::Contradiction) }
11
+ end
@@ -1,6 +1,8 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
- describe Logic::Proposition::Tautology, '#inspect' do
5
+ describe Function::Proposition::Tautology, '#inspect' do
4
6
  subject { object.inspect }
5
7
 
6
8
  let(:object) { described_class.instance }
@@ -1,13 +1,15 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
- describe Logic::Proposition::Tautology, '#inverse' do
5
+ describe Function::Proposition::Tautology, '#inverse' do
4
6
  subject { object.inverse }
5
7
 
6
8
  let(:object) { described_class.instance }
7
9
 
8
10
  it_should_behave_like 'an idempotent method'
9
11
 
10
- it { should equal(Logic::Proposition::Contradiction.instance) }
12
+ it { should equal(Function::Proposition::Contradiction.instance) }
11
13
 
12
14
  it 'is invertible' do
13
15
  subject.inverse.should equal(object)
@@ -1,6 +1,8 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
- describe Logic::Proposition::Tautology, '#or' do
5
+ describe Function::Proposition::Tautology, '#or' do
4
6
  subject { object.or(other) }
5
7
 
6
8
  let(:other) { mock('other') }
@@ -0,0 +1,12 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Function::Proposition, '#type' do
6
+ subject { object.type }
7
+
8
+ let(:described_class) { Class.new(Function::Proposition) }
9
+ let(:object) { described_class.new }
10
+
11
+ it { should equal(Attribute::Boolean) }
12
+ end
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+ require File.expand_path('../fixtures/classes', __FILE__)
5
+
6
+ describe Function, '#rename' do
7
+ subject { object.rename(aliases) }
8
+
9
+ let(:described_class) { FunctionSpecs::Object }
10
+ let(:aliases) { mock('Aliases') }
11
+ let(:object) { described_class.new }
12
+
13
+ specify { expect { subject }.to raise_error(NotImplementedError, "#{described_class}#rename must be implemented") }
14
+ end
@@ -0,0 +1,12 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Function::String::Length, '.call' do
6
+ subject { object.call(value) }
7
+
8
+ let(:object) { described_class }
9
+ let(:value) { 'a string' }
10
+
11
+ it { should eql(8) }
12
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Function::String::Length, '#inspect' do
6
+ subject { object.inspect }
7
+
8
+ let(:object) { described_class.new('a string') }
9
+
10
+ it { should == 'LENGTH("a string")' }
11
+ end
@@ -0,0 +1,14 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Function::String::Length::Methods, '#length' do
6
+ subject { object.length }
7
+
8
+ let(:described_class) { Class.new { include Function::String::Length::Methods } }
9
+ let(:object) { described_class.new.freeze }
10
+
11
+ it { should be_kind_of(Function::String::Length) }
12
+
13
+ its(:operand) { should equal(object) }
14
+ end
@@ -0,0 +1,11 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Function::String::Length, '#type' do
6
+ subject { object.type }
7
+
8
+ let(:object) { described_class.new('string') }
9
+
10
+ it { should equal(Attribute::Integer) }
11
+ end
@@ -0,0 +1,13 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+ require File.expand_path('../fixtures/classes', __FILE__)
5
+
6
+ describe Function, '#type' do
7
+ subject { object.type }
8
+
9
+ let(:described_class) { FunctionSpecs::Object }
10
+ let(:object) { described_class.new }
11
+
12
+ specify { expect { subject }.to raise_error(NotImplementedError, "#{described_class}#type must be implemented") }
13
+ end
@@ -1,7 +1,9 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require File.expand_path('../fixtures/classes', __FILE__)
3
5
 
4
- describe Logic::Connective::Unary, '#call' do
6
+ describe Function::Unary, '#call' do
5
7
  subject { object.call(tuple) }
6
8
 
7
9
  let(:described_class) { UnarySpecs::Object }
@@ -1,7 +1,9 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require File.expand_path('../fixtures/classes', __FILE__)
3
5
 
4
- describe Logic::Connective::Unary, '#==' do
6
+ describe Function::Unary, '#==' do
5
7
  subject { object == other }
6
8
 
7
9
  let(:described_class) { UnarySpecs::Object }
@@ -1,5 +1,9 @@
1
+ # encoding: utf-8
2
+
1
3
  module UnarySpecs
2
- class Object < Logic::Connective::Unary
4
+ class Object < Function
5
+ include Function::Unary, Function::Unary::Invertible
6
+
3
7
  def inspect
4
8
  "Unary(#{operand.inspect})"
5
9
  end
@@ -0,0 +1,37 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Function::Unary::Invertible, '#inverse' do
6
+ subject { object.inverse }
7
+
8
+ let(:described_class) { Class.new(Function) { include Function::Unary } }
9
+ let(:operand) { mock('Operand').freeze }
10
+ let(:object) { described_class.new(operand) }
11
+
12
+ before do
13
+ described_class.class_eval do
14
+ include Function::Unary::Invertible
15
+
16
+ def self.inverse
17
+ self
18
+ end
19
+
20
+ def inspect
21
+ 'Unary::Invertible'
22
+ end
23
+ end
24
+ end
25
+
26
+ it_should_behave_like 'an idempotent method'
27
+
28
+ it { should be_kind_of(described_class) }
29
+
30
+ it { should_not equal(object) }
31
+
32
+ its(:operand) { should equal(operand) }
33
+
34
+ it 'is invertible' do
35
+ subject.inverse.should equal(object)
36
+ end
37
+ end
@@ -1,7 +1,9 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require File.expand_path('../fixtures/classes', __FILE__)
3
5
 
4
- describe Logic::Connective::Unary, '#rename' do
6
+ describe Function::Unary, '#rename' do
5
7
  subject { object.rename(aliases) }
6
8
 
7
9
  let(:described_class) { UnarySpecs::Object }
@@ -16,7 +18,7 @@ describe Logic::Connective::Unary, '#rename' do
16
18
 
17
19
  it { should be_kind_of(described_class) }
18
20
 
19
- its(:operand) { should == other.eq(1) }
21
+ its(:operand) { should eql(other.eq(1)) }
20
22
  end
21
23
 
22
24
  context 'operand is not renamed' do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Immutable, '.freeze_object' do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require File.expand_path('../../fixtures/classes', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require File.expand_path('../fixtures/classes', __FILE__)
3
5
 
@@ -1,25 +1,27 @@
1
+ # encoding: utf-8
2
+
1
3
  module ImmutableSpecs
2
4
  class Object
3
5
  include Immutable
4
6
 
5
7
  def test
6
- rand
8
+ 'test'
7
9
  end
8
10
 
9
11
  def public_method
10
- rand
12
+ 'public_method'
11
13
  end
12
14
 
13
15
  protected
14
16
 
15
17
  def protected_method
16
- rand
18
+ 'protected_method'
17
19
  end
18
20
 
19
21
  private
20
22
 
21
23
  def private_method
22
- rand
24
+ 'private_method'
23
25
  end
24
26
 
25
27
  end # class Object
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require File.expand_path('../fixtures/classes', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require File.expand_path('../fixtures/classes', __FILE__)
3
5
 
@@ -7,14 +9,36 @@ describe Immutable, '#memoize' do
7
9
  let(:described_class) { Class.new(ImmutableSpecs::Object) }
8
10
  let(:object) { described_class.new }
9
11
  let(:method) { :test }
10
- let(:value) { String.new.freeze }
11
12
 
12
13
  before do
13
14
  described_class.memoize(method)
14
15
  end
15
16
 
16
- it 'sets the memoized value for the method to the value' do
17
- subject
18
- object.send(method).should equal(value)
17
+ context 'when the value is frozen' do
18
+ let(:value) { String.new.freeze }
19
+
20
+ it 'sets the memoized value for the method to the value' do
21
+ subject
22
+ object.send(method).should equal(value)
23
+ end
24
+
25
+ it 'creates a method that returns a frozen value' do
26
+ subject
27
+ object.send(method).should be_frozen
28
+ end
29
+ end
30
+
31
+ context 'when the value is not frozen' do
32
+ let(:value) { String.new }
33
+
34
+ it 'sets the memoized value for the method to the value' do
35
+ subject
36
+ object.send(method).should eql(value)
37
+ end
38
+
39
+ it 'creates a method that returns a frozen value' do
40
+ subject
41
+ object.send(method).should be_frozen
42
+ end
19
43
  end
20
44
  end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require File.expand_path('../fixtures/classes', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Immutable::Memory, '#[]' do
@@ -1,11 +1,13 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Immutable::Memory, '#[]=' do
4
6
  subject { object[key] = value }
5
7
 
6
- let(:object) { described_class.new }
7
- let(:key) { '@key' }
8
- let(:value) { mock('Value', :frozen? => true) }
8
+ let(:object) { described_class.new }
9
+ let(:key) { '@key' }
10
+ let(:value) { mock('Value') }
9
11
 
10
12
  it { should equal(value) }
11
13
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require File.expand_path('../../fixtures/classes', __FILE__)
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
  require File.expand_path('../../fixtures/classes', __FILE__)
3
5
 
@@ -8,6 +10,12 @@ shared_examples_for 'memoizes method' do
8
10
  instance.send(method).should equal(instance.send(method))
9
11
  end
10
12
 
13
+ it 'creates a method that returns a frozen value' do
14
+ subject
15
+ instance = object.new
16
+ instance.send(method).should be_frozen
17
+ end
18
+
11
19
  specification = proc do
12
20
  object.send(:define_method, method) do
13
21
  caller
@@ -18,7 +26,7 @@ shared_examples_for 'memoizes method' do
18
26
  file, line = object.new.send(method).first.split(':')[0, 2]
19
27
 
20
28
  File.expand_path(file).should == File.expand_path('../../../../../../lib/veritas/support/immutable.rb', __FILE__)
21
- line.to_i.should == 177
29
+ line.to_i.should == 179
22
30
  end
23
31
 
24
32
  it 'sets the file and line number properly' do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Operation::Binary, '#eql?' do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Operation::Binary, '#hash' do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Operation::Binary, '#left' do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Operation::Binary, '#right' do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Operation::Unary, '#eql?' do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Operation::Unary, '#hash' do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Operation::Unary, '#operand' do
@@ -0,0 +1,45 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe Relation::Base, '#name' do
6
+ subject { object.name }
7
+
8
+ let(:header) { [ [ :id, Integer ] ] }
9
+ let(:body) { [ [ 1 ] ].each }
10
+ let(:object) { described_class.new(name, header, body) }
11
+
12
+ context 'when name is a frozen String' do
13
+ let(:name) { 'users'.freeze }
14
+
15
+ it_should_behave_like 'an idempotent method'
16
+
17
+ it { should equal(name) }
18
+
19
+ it { should be_frozen }
20
+ end
21
+
22
+ context 'when name is a String' do
23
+ let(:name) { 'users' }
24
+
25
+ it_should_behave_like 'an idempotent method'
26
+
27
+ it { should_not equal(name) }
28
+
29
+ it { should eql(name) }
30
+
31
+ it { should be_frozen }
32
+ end
33
+
34
+ context 'when name responds to #to_s' do
35
+ let(:name) { :users }
36
+
37
+ it_should_behave_like 'an idempotent method'
38
+
39
+ it { should_not equal(name) }
40
+
41
+ it { should eql(name.to_s) }
42
+
43
+ it { should be_frozen }
44
+ end
45
+ end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Relation, '.new' do
@@ -1,9 +1,11 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Relation, '#directions' do
4
6
  subject { object.directions }
5
7
 
6
- let(:body) { [ [ 1 ] ].each } # use an Enumerator
8
+ let(:body) { [].each } # use an Enumerator
7
9
  let(:object) { described_class.new([ [ :id, Integer ] ], body) }
8
10
 
9
11
  before do
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'spec_helper'
2
4
 
3
5
  describe Relation, '#each' do