krikri 0.12.3 → 0.12.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (280) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/krikri/_qa_report_list.html.erb~ +10 -0
  3. data/app/controllers/krikri/concerns/provider_context.rb~ +7 -0
  4. data/app/controllers/krikri/qa_reports_controller.rb~ +18 -0
  5. data/app/models/krikri/original_record_desc.rb~ +6 -0
  6. data/app/models/krikri/original_record_metadata.rb~ +9 -0
  7. data/app/models/krikri/parser.rb~ +5 -0
  8. data/app/models/krikri/parsers/xml_parser.rb~ +5 -0
  9. data/app/models/krikri/qa_report.rb~ +7 -0
  10. data/app/views/krikri/qa_reports/index.html.erb~ +3 -0
  11. data/app/views/krikri/qa_reports/show.html.erb~ +1 -0
  12. data/config/initializers/config.rb~ +19 -0
  13. data/config/settings/test.yml~ +3 -0
  14. data/db/migrate/20150328035550_add_qa_report.rb~ +11 -0
  15. data/lib/krikri/enrichments/language_to_lexvo.rb +1 -1
  16. data/lib/krikri/enrichments/split_on_provided_label.rb +58 -0
  17. data/lib/krikri/ldp/container.rb~ +22 -0
  18. data/lib/krikri/ldp/nr_source.rb~ +4 -0
  19. data/lib/krikri/ldp/rdf_source.rb~ +24 -0
  20. data/lib/krikri/ldp/resource.rb~ +49 -0
  21. data/lib/krikri/map_crosswalk.rb +1 -1
  22. data/lib/krikri/parsers/json_parser.rb~ +17 -0
  23. data/lib/krikri/parsers/oai_headers.rb~ +4 -0
  24. data/lib/krikri/parsers/oai_parser.rb~ +2 -0
  25. data/lib/krikri/parsers/oai_parser_headers.rb~ +4 -0
  26. data/lib/krikri/parsers/xml_parser.rb~ +61 -0
  27. data/lib/krikri/util/edtf_converter.rb~ +26 -0
  28. data/lib/krikri/util/extended_date_parser.rb +14 -1
  29. data/lib/krikri/util/extended_date_parser.rb~ +70 -0
  30. data/lib/krikri/version.rb +1 -1
  31. data/lib/tasks/jetty.rake~ +12 -0
  32. data/lib/tasks/krikri.rake~ +20 -0
  33. data/spec/controllers/application_controller_spec.rb~ +11 -0
  34. data/spec/controllers/qa_reports_controller_spec.rb~ +15 -0
  35. data/spec/controllers/records_controller_spec.rb~ +11 -0
  36. data/spec/controllers/reports_controller_spec.rb~ +6 -0
  37. data/spec/controllers/validation_reports_controller_spec.rb~ +15 -0
  38. data/spec/factories/krikri_original_record.rb~ +5 -0
  39. data/spec/factories/krikri_provider.rb~ +7 -0
  40. data/spec/factories/krikri_provider_spec.rb~ +7 -0
  41. data/spec/factories/krikri_qa_report.rb~ +8 -0
  42. data/spec/helpers/krikri/application_helper_spec.rb~ +16 -0
  43. data/spec/internal/Gemfile +3 -3
  44. data/spec/internal/Gemfile.lock +42 -51
  45. data/spec/internal/app/assets/javascripts/application.js +1 -1
  46. data/spec/internal/config/initializers/blacklight_initializer.rb +1 -1
  47. data/spec/internal/config/initializers/devise.rb +2 -2
  48. data/spec/internal/config/secrets.yml +2 -2
  49. data/spec/internal/db/development.sqlite3 +0 -0
  50. data/spec/internal/db/migrate/{20160226160200_devise_create_users.rb → 20160407153644_devise_create_users.rb} +0 -0
  51. data/spec/internal/db/migrate/{20160226160226_create_searches.blacklight.rb → 20160407153706_create_searches.blacklight.rb} +0 -0
  52. data/spec/internal/db/migrate/{20160226160227_create_bookmarks.blacklight.rb → 20160407153707_create_bookmarks.blacklight.rb} +0 -0
  53. data/spec/internal/db/migrate/{20160226160228_add_polymorphic_type_to_bookmarks.blacklight.rb → 20160407153708_add_polymorphic_type_to_bookmarks.blacklight.rb} +0 -0
  54. data/spec/internal/db/schema.rb +1 -1
  55. data/spec/internal/db/test.sqlite3 +0 -0
  56. data/spec/internal/lib/generators/test_app_generator.rb~ +14 -0
  57. data/spec/internal/log/development.log +93 -93
  58. data/spec/internal/log/test.log +126244 -0
  59. data/spec/internal/tmp/cache/318/301/krikri%2Fapplication_helper%2Favailable_providers +0 -0
  60. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_alerts.scssc +0 -0
  61. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_background-variant.scssc +0 -0
  62. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_border-radius.scssc +0 -0
  63. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_buttons.scssc +0 -0
  64. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_center-block.scssc +0 -0
  65. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_clearfix.scssc +0 -0
  66. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_forms.scssc +0 -0
  67. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_gradients.scssc +0 -0
  68. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_grid-framework.scssc +0 -0
  69. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_grid.scssc +0 -0
  70. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_hide-text.scssc +0 -0
  71. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_image.scssc +0 -0
  72. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_labels.scssc +0 -0
  73. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_list-group.scssc +0 -0
  74. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_nav-divider.scssc +0 -0
  75. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_nav-vertical-align.scssc +0 -0
  76. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_opacity.scssc +0 -0
  77. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_pagination.scssc +0 -0
  78. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_panels.scssc +0 -0
  79. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_progress-bar.scssc +0 -0
  80. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_reset-filter.scssc +0 -0
  81. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_resize.scssc +0 -0
  82. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_responsive-visibility.scssc +0 -0
  83. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_size.scssc +0 -0
  84. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_tab-focus.scssc +0 -0
  85. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_table-row.scssc +0 -0
  86. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_text-emphasis.scssc +0 -0
  87. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_text-overflow.scssc +0 -0
  88. data/spec/internal/tmp/cache/assets/test/sass/4a3ee647961c7e45976eb2c0a94406aad3427b3d/_vendor-prefixes.scssc +0 -0
  89. data/spec/internal/tmp/cache/assets/test/sass/93e201cf4a11978a1f491a057a3bd569c3825210/blacklight.css.scssc +0 -0
  90. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_alerts.scssc +0 -0
  91. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_badges.scssc +0 -0
  92. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_breadcrumbs.scssc +0 -0
  93. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_button-groups.scssc +0 -0
  94. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_buttons.scssc +0 -0
  95. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_carousel.scssc +0 -0
  96. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_close.scssc +0 -0
  97. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_code.scssc +0 -0
  98. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_component-animations.scssc +0 -0
  99. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_dropdowns.scssc +0 -0
  100. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_forms.scssc +0 -0
  101. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_glyphicons.scssc +0 -0
  102. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_grid.scssc +0 -0
  103. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_input-groups.scssc +0 -0
  104. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_jumbotron.scssc +0 -0
  105. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_labels.scssc +0 -0
  106. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_list-group.scssc +0 -0
  107. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_media.scssc +0 -0
  108. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_mixins.scssc +0 -0
  109. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_modals.scssc +0 -0
  110. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_navbar.scssc +0 -0
  111. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_navs.scssc +0 -0
  112. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_normalize.scssc +0 -0
  113. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_pager.scssc +0 -0
  114. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_pagination.scssc +0 -0
  115. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_panels.scssc +0 -0
  116. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_popovers.scssc +0 -0
  117. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_print.scssc +0 -0
  118. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_progress-bars.scssc +0 -0
  119. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_responsive-embed.scssc +0 -0
  120. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_responsive-utilities.scssc +0 -0
  121. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_scaffolding.scssc +0 -0
  122. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_tables.scssc +0 -0
  123. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_thumbnails.scssc +0 -0
  124. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_tooltip.scssc +0 -0
  125. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_type.scssc +0 -0
  126. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_utilities.scssc +0 -0
  127. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_variables.scssc +0 -0
  128. data/spec/internal/tmp/cache/assets/test/sass/a1ec1bb9c9cafeb054d542e861ebc8ffd5904439/_wells.scssc +0 -0
  129. data/spec/internal/tmp/cache/assets/test/sass/b28605b1c659cf09fc72f3c1fff32918869d28b8/_bootstrap-sprockets.scssc +0 -0
  130. data/spec/internal/tmp/cache/assets/test/sass/b28605b1c659cf09fc72f3c1fff32918869d28b8/_bootstrap.scssc +0 -0
  131. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/_blacklight_base.scssc +0 -0
  132. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/_bookmark.scssc +0 -0
  133. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/_catalog.scssc +0 -0
  134. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/_facets.scssc +0 -0
  135. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/_group.scssc +0 -0
  136. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/_header.scssc +0 -0
  137. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/_layout.scssc +0 -0
  138. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/_modal.scssc +0 -0
  139. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/_search_history.scssc +0 -0
  140. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/blacklight.scssc +0 -0
  141. data/spec/internal/tmp/cache/assets/test/sass/ca8c12d03785e0d6cd4554f4d3939e7836d38282/blacklight_defaults.scssc +0 -0
  142. data/spec/internal/tmp/cache/assets/test/sprockets/059eceaa18e2eaee3d5168f3949f4957 +0 -0
  143. data/spec/internal/tmp/cache/assets/test/sprockets/093d898bf3f20b26b13c82714a77c040 +0 -0
  144. data/spec/internal/tmp/cache/assets/test/sprockets/10517c9579f8d23c82fb8caa66dca6a7 +0 -0
  145. data/spec/internal/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  146. data/spec/internal/tmp/cache/assets/test/sprockets/19f4ba6fa86d2609c171da9f5ee3b11a +0 -0
  147. data/spec/internal/tmp/cache/assets/test/sprockets/2bec18569db80effd80a2a19a038100b +0 -0
  148. data/spec/internal/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  149. data/spec/internal/tmp/cache/assets/test/sprockets/30ca7caa200fa8eaddaef443913ad9ad +0 -0
  150. data/spec/internal/tmp/cache/assets/test/sprockets/350a65d446eb7398f96d102f7a1a6d69 +0 -0
  151. data/spec/internal/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  152. data/spec/internal/tmp/cache/assets/test/sprockets/4052820c15af72ba690230a0f92bd75e +0 -0
  153. data/spec/internal/tmp/cache/assets/test/sprockets/41b62fb10530766b5b9fef3338f5f30b +0 -0
  154. data/spec/internal/tmp/cache/assets/test/sprockets/421c89c58d3e76046a0294dae1f731ff +0 -0
  155. data/spec/internal/tmp/cache/assets/test/sprockets/43da966542fafc2a4c768be78527391c +0 -0
  156. data/spec/internal/tmp/cache/assets/test/sprockets/496a0d7dce1ff6bf4a9c3a089ea3a635 +0 -0
  157. data/spec/internal/tmp/cache/assets/test/sprockets/4e93570db72bb61820711448b78d548d +0 -0
  158. data/spec/internal/tmp/cache/assets/test/sprockets/50b9db0b908b421a9b941a445dbaeacc +0 -0
  159. data/spec/internal/tmp/cache/assets/test/sprockets/5155772cce704d83a64aa83eeda20c5a +0 -0
  160. data/spec/internal/tmp/cache/assets/test/sprockets/528c628cf107f8be6dd122e1154344be +0 -0
  161. data/spec/internal/tmp/cache/assets/test/sprockets/5ed02c7072bb024fa0832a1ca4113227 +0 -0
  162. data/spec/internal/tmp/cache/assets/test/sprockets/60141dc3d16c502963c3d798a099862d +0 -0
  163. data/spec/internal/tmp/cache/assets/test/sprockets/6df5b5c0a8e6d87ced9504a460df875e +0 -0
  164. data/spec/internal/tmp/cache/assets/test/sprockets/6eefd2765a716d66ff857cfcda69a119 +0 -0
  165. data/spec/internal/tmp/cache/assets/test/sprockets/72848ec252813c930e57868edab843b5 +0 -0
  166. data/spec/internal/tmp/cache/assets/test/sprockets/88ded10f28177bec1bddb0d72d6b1cd2 +0 -0
  167. data/spec/internal/tmp/cache/assets/test/sprockets/8edfca9082e02111be92e79000667f22 +0 -0
  168. data/spec/internal/tmp/cache/assets/test/sprockets/90b54a819800edfa41b67722d1561040 +0 -0
  169. data/spec/internal/tmp/cache/assets/test/sprockets/927d682c9287262facf9333dfaef813c +0 -0
  170. data/spec/internal/tmp/cache/assets/test/sprockets/93aaa9231a32901266b05632f3d35ecd +0 -0
  171. data/spec/internal/tmp/cache/assets/test/sprockets/9c653367feff82588eb6041d783a5809 +0 -0
  172. data/spec/internal/tmp/cache/assets/test/sprockets/9ce190f082dc4fb74bddb818cc011ce6 +0 -0
  173. data/spec/internal/tmp/cache/assets/test/sprockets/ab2a05b91d7d316d4ceb47ce067006fb +0 -0
  174. data/spec/internal/tmp/cache/assets/test/sprockets/ad4a54c43c2a4c3874bfde1c9f08c248 +0 -0
  175. data/spec/internal/tmp/cache/assets/test/sprockets/b1a42de74c934edd0e5eed0f98a23597 +0 -0
  176. data/spec/internal/tmp/cache/assets/test/sprockets/b1c03c36188b4f58f819510adb9a7e9c +0 -0
  177. data/spec/internal/tmp/cache/assets/test/sprockets/b225d67626669cb154cbe08a3c439d48 +0 -0
  178. data/spec/internal/tmp/cache/assets/test/sprockets/b35e12934e9f05662777579549e31cd7 +0 -0
  179. data/spec/internal/tmp/cache/assets/test/sprockets/b3ae9e3cdd9991d7103b0a00e33b5778 +0 -0
  180. data/spec/internal/tmp/cache/assets/test/sprockets/b42c247628daaf44109584724682a6ad +0 -0
  181. data/spec/internal/tmp/cache/assets/test/sprockets/b660ec1ede271559cfd0259eed96ae9c +0 -0
  182. data/spec/internal/tmp/cache/assets/test/sprockets/ba078b29a7f067b3acdd538a286235a8 +0 -0
  183. data/spec/internal/tmp/cache/assets/test/sprockets/bb108ef3fc4c96d1c20cc41f97d943a0 +0 -0
  184. data/spec/internal/tmp/cache/assets/test/sprockets/bb92f4b8c1bedafe60b6f226b549138a +0 -0
  185. data/spec/internal/tmp/cache/assets/test/sprockets/c644ecad928e076f999e9c9a3bc350c9 +0 -0
  186. data/spec/internal/tmp/cache/assets/test/sprockets/c78dd20a0df27e9394a413bf2e4abf92 +0 -0
  187. data/spec/internal/tmp/cache/assets/test/sprockets/c9efce42580b0ad0374a052aa61f2a07 +0 -0
  188. data/spec/internal/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  189. data/spec/internal/tmp/cache/assets/test/sprockets/d1bce36d6e3ab792562b9c929f2ce897 +0 -0
  190. data/spec/internal/tmp/cache/assets/test/sprockets/d23c35c7aba77b1c68e42603120aebd2 +0 -0
  191. data/spec/internal/tmp/cache/assets/test/sprockets/d24a7c4b8ac71a90e809881a64970898 +0 -0
  192. data/spec/internal/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  193. data/spec/internal/tmp/cache/assets/test/sprockets/db0d9534ecdebba33af5d1d81060e855 +0 -0
  194. data/spec/internal/tmp/cache/assets/test/sprockets/dbba4bbc32c17ade3d618c5d0baeb371 +0 -0
  195. data/spec/internal/tmp/cache/assets/test/sprockets/e315f2e6fe546b7a0e37fcfc0f647c84 +0 -0
  196. data/spec/internal/tmp/cache/assets/test/sprockets/e8276b98892dcac8285a592bb63fe75b +0 -0
  197. data/spec/internal/tmp/cache/assets/test/sprockets/e9f7ccc553ce1a217709cc7a08cfb032 +0 -0
  198. data/spec/internal/tmp/cache/assets/test/sprockets/ecfc314951b349e27742c1b26880619e +0 -0
  199. data/spec/internal/tmp/cache/assets/test/sprockets/eddae0741d973a8ab3df27c1ea5b635e +0 -0
  200. data/spec/internal/tmp/cache/assets/test/sprockets/f274b5f22db177b6464b50691d531688 +0 -0
  201. data/spec/internal/tmp/cache/assets/test/sprockets/f3935581a84aba9a499005ed6a8e18be +0 -0
  202. data/spec/internal/tmp/cache/assets/test/sprockets/f3e7729c53b8a2c408086a61b58922ae +0 -0
  203. data/spec/internal/tmp/cache/assets/test/sprockets/f45dfdb34e84d3c72a3319399a7316a3 +0 -0
  204. data/spec/internal/tmp/cache/assets/test/sprockets/f74af03e26e893af40b07a6d0f970cd4 +0 -0
  205. data/spec/internal/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  206. data/spec/internal/tmp/cache/assets/test/sprockets/fa11f1beb15b0f04503ce1f06701a8bf +0 -0
  207. data/spec/internal/tmp/cache/assets/test/sprockets/faac2909046aa87e1f1f08b2bf0ad2b2 +0 -0
  208. data/spec/krikri_spec.rb~ +30 -0
  209. data/spec/ldp/active_triples_spec.rb~ +15 -0
  210. data/spec/ldp/at_resource_spec.rb~ +41 -0
  211. data/spec/ldp/nr_source_spec.rb~ +3 -0
  212. data/spec/ldp/rdf_source_spec.rb~ +4 -0
  213. data/spec/ldp/resource_spec.rb~ +49 -0
  214. data/spec/lib/krikri/enrichment_agent_spec.rb~ +4 -0
  215. data/spec/lib/krikri/enrichments/language_to_lexvo_spec.rb +5 -0
  216. data/spec/lib/krikri/enrichments/split_on_provided_label_spec.rb +42 -0
  217. data/spec/lib/krikri/harvesters/api_harvester_spec.rb~ +47 -0
  218. data/spec/lib/krikri/harvesters/basic_save_behavior_spec.rb~ +12 -0
  219. data/spec/lib/krikri/harvesters/file_harvester_spec.rb~ +3 -0
  220. data/spec/lib/krikri/harvesters/harvest_behavior_spec.rb~ +5 -0
  221. data/spec/lib/krikri/harvesters/mdl_api_harvester_spec.rb~ +11 -0
  222. data/spec/lib/krikri/harvesters/mdl_harvester_spec.rb~ +8 -0
  223. data/spec/lib/krikri/harvesters/oai_skip_deleted_behavior.rb~ +7 -0
  224. data/spec/lib/krikri/harvesters/oai_skip_deleted_behavior_spec.rb~ +15 -0
  225. data/spec/lib/krikri/id_service_spec.rb~ +3 -0
  226. data/spec/lib/krikri/job_spec.rb~ +13 -0
  227. data/spec/lib/krikri/map_crosswalk_spec.rb +15 -0
  228. data/spec/lib/krikri/map_crosswalk_spec.rb~ +5 -0
  229. data/spec/lib/krikri/mapper_agent_spec.rb~ +64 -0
  230. data/spec/lib/krikri/mapper_spec.rb~ +5 -0
  231. data/spec/lib/krikri/mapping_dsl/parser_methods_spec.rb~ +65 -0
  232. data/spec/lib/krikri/mapping_dsl/property_declaration_spec.rb~ +87 -0
  233. data/spec/lib/krikri/mapping_dsl/rdf_subjects_spec.rb~ +16 -0
  234. data/spec/lib/krikri/mapping_dsl_spec.rb~ +10 -0
  235. data/spec/lib/krikri/mapping_job.rb~ +12 -0
  236. data/spec/lib/krikri/mapping_job_spec.rb~ +11 -0
  237. data/spec/lib/krikri/mapping_spec.rb~ +5 -0
  238. data/spec/lib/krikri/md5_minter_spec.rb~ +5 -0
  239. data/spec/lib/krikri/parser_value_array.rb~ +5 -0
  240. data/spec/lib/krikri/parsers/json_parser_spec.rb~ +17 -0
  241. data/spec/lib/krikri/parsers/xml_parser_spec.rb~ +21 -0
  242. data/spec/lib/krikri/provenance_query_client.rb~ +5 -0
  243. data/spec/lib/krikri/provenance_query_client_spec.rb~ +8 -0
  244. data/spec/lib/krikri/qa_query_client_spec.rb~ +9 -0
  245. data/spec/lib/krikri/random_search_index_docmument_builder_spec.rb~ +6 -0
  246. data/spec/lib/krikri/util/edtf_converter_spec.rb~ +17 -0
  247. data/spec/lib/krikri/util/extended_date_parser_spec.rb +8 -1
  248. data/spec/lib/krikri/util/extended_date_parser_spec.rb~ +102 -0
  249. data/spec/models/activity_spec.rb~ +41 -0
  250. data/spec/models/dpla/map/aggregation_spec.rb~ +67 -0
  251. data/spec/models/harvesters/oai_harvester_spec.rb~ +15 -0
  252. data/spec/models/mapper_spec.rb~ +5 -0
  253. data/spec/models/original_record_metadata_spec.rb~ +5 -0
  254. data/spec/models/original_record_spec.rb~ +5 -0
  255. data/spec/models/provider_spec.rb~ +33 -0
  256. data/spec/models/qa_report_spec.rb~ +64 -0
  257. data/spec/models/validation_report_spec.rb~ +15 -0
  258. data/spec/support/shared_contexts/indexed_item.rb~ +15 -0
  259. data/spec/support/shared_contexts/mapping_dsl.rb~ +12 -0
  260. data/spec/support/shared_contexts/provenance_query_client.rb~ +6 -0
  261. data/spec/support/shared_contexts/rake.rb~ +21 -0
  262. data/spec/support/shared_examples/enrichment.rb~ +5 -0
  263. data/spec/support/shared_examples/harvest_behavior.rb~ +13 -0
  264. data/spec/support/shared_examples/job.rb~ +20 -0
  265. data/spec/support/shared_examples/ldp_resource.rb~ +4 -0
  266. data/spec/support/shared_examples/oai_parser_headers.rb~ +12 -0
  267. data/spec/support/shared_examples/rdf_source.rb~ +1 -0
  268. data/spec/support/shared_examples/software_agent.rb~ +5 -0
  269. data/spec/support/shared_examples/string_enrichment.rb~ +12 -0
  270. data/spec/test_app_templates/lib/generators/test_app_generator.rb~ +14 -0
  271. data/spec/views/krikri/providers/index.html.erb_spec.rb~ +3 -0
  272. data/spec/views/krikri/providers/show.html.erb.spec~ +12 -0
  273. data/spec/views/krikri/providers/show.html.erb_spec.rb~ +10 -0
  274. data/spec/views/krikri/qa_reports/index.html.erb_spec.rb~ +17 -0
  275. data/spec/views/krikri/qa_reports/show.html.erb_spec.rb~ +22 -0
  276. data/spec/views/krikri/records/index.html.erb_spec.rb~ +15 -0
  277. data/spec/views/krikri/records/show.html.erb_spec.rb~ +8 -0
  278. data/spec/views/krikri/reports/index.html.erb_spec.rb~ +5 -0
  279. data/spec/webmocks/oai.rb~ +13 -0
  280. metadata +650 -163
@@ -0,0 +1,3 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::LDP::Resource do
@@ -0,0 +1,4 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::LDP::RdfSource do
4
+ end
@@ -0,0 +1,49 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::LDP::Resource do
4
+ before do
5
+ class DummyResource; include Krikri::LDP::Resource; end
6
+ subject.connection_uri = 'http://localhost:8080/marmotta/ldp'
7
+ end
8
+
9
+ subject { DummyResource.new }
10
+ let(:base_uri) { 'http://localhost:8080/marmotta/ldp/container' }
11
+ let(:slug) { 'moomin' }
12
+
13
+ it 'has a connection' do
14
+ expect(subject.ldp_connection).to be_a Faraday::Connection
15
+ require 'pry'
16
+ binding.pry
17
+ end
18
+
19
+ describe '#create' do
20
+ it 'creates ldp resources' do
21
+ require 'pry'
22
+ binding.pry
23
+ expect { subject.create(base_uri, nil) }.not_to raise_error
24
+ end
25
+
26
+ it 'accepts slug' do
27
+ expect(subject.create(base_uri, nil, :Slug => slug)
28
+ .env['response_headers']['location'])
29
+ .to eq 'http://localhost:8080/marmotta/ldp/container/moomin'
30
+ end
31
+ end
32
+
33
+ describe '#save' do
34
+ it 'is idempotent' do
35
+ first = subject.save(base_uri, nil, :Slug => slug)
36
+ second = subject.save(base_uri, nil, :Slug => slug)
37
+
38
+ expect(first.env['response_headers']['location'])
39
+ .to eq second.env['response_headers']['location']
40
+ end
41
+ end
42
+
43
+ describe '#exists?' do
44
+ it "knows it doesn't exist" do
45
+ expect(subject).not_to exist
46
+ end
47
+ end
48
+
49
+ end
@@ -0,0 +1,4 @@
1
+ describe Krikri::Enrichment::Agent do
2
+ opts = {}
3
+ it_behaves_like 'a software agent', opts
4
+ end
@@ -142,6 +142,11 @@ describe Krikri::Enrichments::LanguageToLexvo do
142
142
  expect(subject.match_iso('eng').rdf_subject)
143
143
  .to eq english
144
144
  end
145
+
146
+ it 'finds 3 letter ISO codes case insensitively' do
147
+ expect(subject.match_iso('Eng').rdf_subject)
148
+ .to eq english
149
+ end
145
150
  end
146
151
 
147
152
  describe '#match_label' do
@@ -0,0 +1,42 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::Enrichments::SplitOnProvidedLabel do
4
+ it_behaves_like 'a field enrichment'
5
+
6
+ describe '#enrich_value' do
7
+ let(:resource) { DPLA::MAP::Agent.new }
8
+
9
+ it 'skips non-resource values' do
10
+ date = Date.today
11
+ expect(subject.enrich_value(date)).to eq date
12
+ end
13
+
14
+ it 'skips values that do not respond to providedLabel' do
15
+ resource = ActiveTriples::Resource.new
16
+ expect(subject.enrich_value(resource)).to eq resource
17
+ end
18
+
19
+ it 'leaves an existing single providedLabel as is' do
20
+ resource.providedLabel = 'moomin'
21
+ expect(subject.enrich_value(resource)).to eq resource
22
+ end
23
+
24
+ it 'leaves existing non-providedLabel values in place' do
25
+ close_match = 'Moomin'
26
+
27
+ resource.providedLabel = ['moomin', 'moominmama']
28
+ resource.closeMatch = close_match
29
+
30
+ expect(subject.enrich_value(resource).map(&:closeMatch))
31
+ .to contain_exactly([close_match], [])
32
+ end
33
+
34
+ it 'splits multiple provided ' do
35
+ labels = ['moomin', 'moominmama']
36
+ resource.providedLabel = labels
37
+
38
+ expect(subject.enrich_value(resource).map(&:providedLabel))
39
+ .to contain_exactly([labels.first], [labels.last])
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,47 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ describe Krikri::Harvesters::ApiHarvester do
5
+ it_behaves_like 'a harvester'
6
+
7
+ let(:args) { { uri: 'http://example.org/endpoint' } }
8
+ subject { described_class.new(args) }
9
+
10
+ shared_context 'with responses' do
11
+ let(:query_opts) { { :q => 'tags_ssim:dpla' } }
12
+ let(:response_string) do
13
+ <<EOM
14
+ { "response": {
15
+ "numFound": 467354,
16
+ "start": 0,
17
+ "docs": []
18
+ }
19
+ }
20
+ EOM
21
+ end
22
+
23
+ before do
24
+ allow(RestClient).to recieve(:get).with(args[:uri], query_opts)
25
+ .and_return(response_string)
26
+ end
27
+ end
28
+
29
+ describe '#new' do
30
+ it 'accepts api parameters' do
31
+ described_class.new()
32
+ require 'pry'
33
+ binding.pry
34
+ end
35
+ end
36
+
37
+ describe '.expected_opts' do
38
+ it 'returns a hash with key and options' do
39
+ end
40
+ end
41
+
42
+ describe '#count' do
43
+ it 'returns a count' do
44
+ expect(subject.count).to eq 100
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::Harvesters::BasicSaveBehavior do
4
+ it_behaves_like 'a harvest behavior'
5
+
6
+ subject { described_class.new(record, activity_uri) }
7
+
8
+
9
+ describe '#process_record' do
10
+ it ''
11
+ end
12
+ end
@@ -0,0 +1,3 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::Harvesters::FileHarvester do
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::Harvesters::HarvestBehavior do
4
+ it_behaves_like 'a harvest behavior'
5
+ end
@@ -0,0 +1,11 @@
1
+ # -*- coding: utf-8 -*-
2
+ require 'spec_helper'
3
+
4
+ describe Krikri::Harvesters::MdlApiHarvester do
5
+ it_behaves_like 'a harvester'
6
+
7
+ let(:args) { { uri: 'http://example.org/endpoint' } }
8
+ subject { described_class.new(args) }
9
+
10
+
11
+ end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::Harvesters::MdlHarvester do
4
+ let(:args) { { uri: 'http://example.org/endpoint', api: query_opts } }
5
+ let(:query_opts) { {} }
6
+ subject { described_class.new(args) }
7
+
8
+ end
@@ -0,0 +1,7 @@
1
+ module Krikri::Harvesters
2
+ class BasicSaveBehavior < HarvestBehavior
3
+ def process_record
4
+ record.save(activity_uri)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::Harvesters::OAISkipDeletedBehavior do
4
+ it_behaves_like 'a harvest behavior'
5
+
6
+ subject { described_class.new(record, activity_uri) }
7
+ let(:record) { double('record') }
8
+ let(:activity_uri) { double('activity URI') }
9
+
10
+ describe '#process_record' do
11
+ it 'calls save when record is not deleted' do
12
+ expect(record).to receive(:save).with(activity_uri)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,3 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::IdService do
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::Job do
4
+ describe '.perform' do
5
+ it 'calls run on activity by id' do
6
+ activity_id = 1
7
+ activity = double('activity')
8
+ end
9
+ end
10
+
11
+ describe '.run' do
12
+ end
13
+ end
@@ -71,6 +71,21 @@ describe Krikri::MapCrosswalk::CrosswalkHashBuilder do
71
71
  end
72
72
  end
73
73
 
74
+ context 'with description' do
75
+ before do
76
+ aggregation.sourceResource.first.description = [desc, desc2]
77
+ subject.build
78
+ end
79
+
80
+ let(:desc) { 'Window of the Stonewall Bar N.Y. 1969.' }
81
+ let(:desc2) { 'A nice description' }
82
+
83
+ it 'has crosswalked multiple descriptions' do
84
+ expect(subject.hash[:sourceResource][:description])
85
+ .to contain_exactly(desc, desc2)
86
+ end
87
+ end
88
+
74
89
  context 'with place' do
75
90
  before do
76
91
  aggregation.sourceResource.first.spatial.first.label = label
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::MapCrosswalk do
4
+ subject { DPLA::MapAggregation }
5
+ end
@@ -0,0 +1,64 @@
1
+ describe Krikri::Mapper::Agent do
2
+ opts = { name: :agent_map, generator_uri: 'http://example.org/agent/gen/1' }
3
+ it_behaves_like 'a software agent', opts, Krikri::MappingJob
4
+
5
+ subject { described_class.new(opts) }
6
+
7
+ let(:generator_uri) { 'http://example.org/agent/gen/1' }
8
+ let(:activity_uri) { 'http://example.org/agent/act/1' }
9
+ let(:mapping_name) { :agent_map }
10
+ let(:opts) { { name: mapping_name, generator_uri: generator_uri } }
11
+
12
+ describe '#run' do
13
+ let(:record_double) { double(DPLA::MAP::Aggregation) }
14
+ let(:records) do
15
+ [record_double, record_double.clone, record_double.clone]
16
+ end
17
+
18
+ before do
19
+ allow(subject).to receive(:records).and_return([:record1, :record2])
20
+ allow(record_double).to receive(:set_subject!)
21
+ allow(record_double).to receive(:save)
22
+ expect(Krikri::Mapper).to receive(:map).with(mapping_name, subject.records)
23
+ .and_return(records)
24
+ end
25
+
26
+ it 'calls mapper' do
27
+ subject.run
28
+ end
29
+
30
+ it 'sets generator' do
31
+ records.each do |rec|
32
+ statement = double
33
+ allow(RDF).to receive(:Statement)
34
+ .with(rec, RDF::PROV.wasGeneratedBy, activity_uri)
35
+ .and_return(statement)
36
+ expect(rec).to receive(:<<).with(statement)
37
+ end
38
+ subject.run(activity_uri)
39
+ end
40
+ end
41
+
42
+ # TODO: these tests are tied closely to implementation.
43
+ # This is a code smell. Consider refactor of ProvenanceQueryClient
44
+ # and #records.
45
+ describe '#records' do
46
+ let(:solutions) { double(RDF::Query::Solutions) }
47
+ let(:solution) { double(RDF::Query::Solutions) }
48
+ let(:record_double) { double(Krikri::OriginalRecord) }
49
+
50
+ it 'returns a lazy enum' do
51
+ expect(subject.records).to be_a Enumerator::Lazy
52
+ end
53
+
54
+ it 'gets records for generated by harvest_activity' do
55
+ expect_any_instance_of(Krikri::ProvenanceQueryClient)
56
+ .to receive(:find_by_activity).with(generator_uri).and_return(solutions)
57
+ expect(solutions).to receive(:lazy).and_return([solution])
58
+ expect(solution).to receive(:record).and_return(:uri)
59
+ expect(OriginalRecord).to receive(:load).with(:uri.to_s)
60
+ .and_return(:record)
61
+ expect(subject.records).to eq [:record]
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::Mapper do
4
+
5
+ end
@@ -0,0 +1,65 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::MappingDSL::ParserMethods do
4
+ before do
5
+ # dummy class
6
+ class DummyParserImpl
7
+ include Krikri::MappingDSL::ParserMethods
8
+ end
9
+ end
10
+
11
+ after do
12
+ Object.send(:remove_const, 'DummyParserImpl')
13
+ end
14
+
15
+ subject { DummyParserImpl.new }
16
+
17
+ it 'raises an error without parser' do
18
+ expect { subject.record }
19
+ .to raise_error 'No parser selected; set a parser with #parser(class)'
20
+ end
21
+
22
+ context 'with parser' do
23
+ before do
24
+ subject.parser parser
25
+ allow_any_instance_of(parser).to receive(:root).and_return()
26
+ end
27
+
28
+ let(:parser) { class_double("Krikri::XmlParser") }
29
+
30
+ describe '#record' do
31
+ it 'returns a parsed value instance' do
32
+ expect(subject.record)
33
+ .to be_a Krikri::MappingDSL::ParserMethods::ParsedValue
34
+ end
35
+
36
+ it 'initializes parsed value with args and parser' do
37
+ expect(Krikri::MappingDSL::ParserMethods::ParsedValue).to receive(:new)
38
+ .with(parser, :arg_1, :arg_2, :arg_3)
39
+ subject.record(:arg_1, :arg_2, :arg_3)
40
+ end
41
+ end
42
+ end
43
+ end
44
+
45
+ describe Krikri::MappingDSL::ParserMethods::ParsedValue do
46
+ subject { described_class.new(parser) }
47
+ let(:record) { double() }
48
+ let(:parser) { class_double("Krikri::XmlParser") }
49
+ let(:root) { instance_double("Krikri::XmlParser") }
50
+ let(:value) { instance_double("Krikri::XmlParser::Value") }
51
+
52
+ describe '#to_proc' do
53
+ # before do
54
+ # expect(parser).to receive(:new).with(record).and_return(:value)
55
+ # end
56
+
57
+ it 'resolves to a parser root' do
58
+ expect(parser).to receive(:new).with(record).and_return(root)
59
+ expect(root).to receive(:root).and_return(value)
60
+ expect(value).to receive(values).and_return(:my_value)
61
+ require 'pry'
62
+ binding.pry
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,87 @@
1
+ require 'spec_helper'
2
+
3
+ describe Krikri::MappingDSL::PropertyDeclaration do
4
+ it_behaves_like 'a named property'
5
+ it_behaves_like 'a valued property'
6
+
7
+ subject { described_class.new(:my_property, value) }
8
+
9
+ describe '#to_proc' do
10
+ shared_context 'mapped property' do
11
+ before do
12
+ expect(mapped).to receive(:my_property=).with(value)
13
+ end
14
+ let(:mapped) { double }
15
+ end
16
+
17
+ shared_context 'property block' do
18
+ subject do
19
+ described_class.new(:my_property, start_value) do |v|
20
+ v.upcase
21
+ end
22
+ end
23
+ let(:start_value) do
24
+ return value.map(&:downcase) if value.is_a? Enumerable
25
+ value.downcase
26
+ end
27
+ end
28
+
29
+ shared_examples 'a property value' do
30
+ it 'gives a proc that sets value' do
31
+ subject.to_proc.call(mapped, '')
32
+ end
33
+ end
34
+
35
+ context 'static' do
36
+ include_context 'mapped property'
37
+ it_behaves_like 'a property value'
38
+ end
39
+
40
+ context 'with multiple values' do
41
+ include_context 'mapped property'
42
+ it_behaves_like 'a property value'
43
+
44
+ let(:value) { %w('value_1', 'value_2') }
45
+
46
+ context 'with block of arity 1' do
47
+ include_context 'property block'
48
+ it_behaves_like 'a property value'
49
+
50
+ let(:value) { %w('value_1', 'value_2').map(&:upcase) }
51
+ end
52
+ end
53
+
54
+ context 'with block of arity 1' do
55
+ include_context 'mapped property'
56
+ include_context 'property block'
57
+ it_behaves_like 'a property value'
58
+
59
+ let(:value) { 'value'.upcase }
60
+ end
61
+
62
+ context 'with callable value' do
63
+ include_context 'mapped property'
64
+ it_behaves_like 'a property value'
65
+
66
+ before do
67
+ expect(proc_value).to receive(:call).and_return(value)
68
+ end
69
+
70
+ subject { described_class.new(:my_property, proc_value) }
71
+
72
+ let(:proc_value) { ->(_) {} }
73
+ end
74
+
75
+ context 'with block of wrong arity' do
76
+ subject do
77
+ described_class.new(:my_property, value) { |v, what| v + what }
78
+ end
79
+
80
+ it 'raises error' do
81
+ expect { subject.to_proc.call(nil, nil) }
82
+ .to raise_error('Block must have arity of 1 to be applied to '\
83
+ 'property')
84
+ end
85
+ end
86
+ end
87
+ end