ppl 3.0.0 → 4.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (334) hide show
  1. checksums.yaml +5 -5
  2. data/.editorconfig +16 -0
  3. data/.eleventy.js +86 -0
  4. data/.eleventyignore +1 -0
  5. data/.github/workflows/build.yml +61 -0
  6. data/.gitignore +3 -1
  7. data/Rakefile +1 -18
  8. data/{CODE_OF_CONDUCT.md → code_of_conduct.md} +1 -1
  9. data/features/step_definitions/ppl_steps.rb +27 -27
  10. data/gh-pages/Gemfile +2 -0
  11. data/gh-pages/_config.yml +5 -0
  12. data/gh-pages/_includes/changelog.html +23 -0
  13. data/gh-pages/_includes/development-sidebar.html +25 -0
  14. data/gh-pages/_includes/footer.html +22 -0
  15. data/gh-pages/_includes/header.html +43 -0
  16. data/gh-pages/_includes/news.html +36 -0
  17. data/gh-pages/_includes/tip.html +54 -0
  18. data/gh-pages/_layouts/changelog.html +1 -0
  19. data/gh-pages/_layouts/command.html +104 -0
  20. data/gh-pages/_layouts/configuration.html +71 -0
  21. data/gh-pages/_layouts/development.html +20 -0
  22. data/gh-pages/_layouts/frontpage.html +6 -0
  23. data/gh-pages/_layouts/integration.html +44 -0
  24. data/gh-pages/_layouts/news.html +2 -0
  25. data/gh-pages/_layouts/page.html +6 -0
  26. data/gh-pages/_layouts/tip.html +2 -0
  27. data/gh-pages/_posts/2012-01-15-first-post.md +16 -0
  28. data/gh-pages/_posts/2012-12-20-1.0.0.md +19 -0
  29. data/gh-pages/_posts/2012-12-20-1.1.0.md +28 -0
  30. data/gh-pages/_posts/2012-12-20-1.2.0.md +18 -0
  31. data/gh-pages/_posts/2012-12-21-1.3.0.md +20 -0
  32. data/gh-pages/_posts/2012-12-21-thank-you-for-your-all-your-feedback.md +26 -0
  33. data/gh-pages/_posts/2012-12-22-1.4.1.md +21 -0
  34. data/gh-pages/_posts/2012-12-22-1.5.0.md +17 -0
  35. data/gh-pages/_posts/2012-12-23-1.5.1.md +13 -0
  36. data/gh-pages/_posts/2012-12-23-1.5.2.md +15 -0
  37. data/gh-pages/_posts/2012-12-26-1.5.3.md +19 -0
  38. data/gh-pages/_posts/2012-12-27-1.6.0.md +18 -0
  39. data/gh-pages/_posts/2012-12-29-1.7.0.md +18 -0
  40. data/gh-pages/_posts/2013-01-05-1.8.0.md +18 -0
  41. data/gh-pages/_posts/2013-01-06-1.9.0.md +20 -0
  42. data/gh-pages/_posts/2013-01-10-1.10.0.md +18 -0
  43. data/gh-pages/_posts/2013-01-20-1.11.0.md +14 -0
  44. data/gh-pages/_posts/2013-02-16-1.12.0.md +14 -0
  45. data/gh-pages/_posts/2013-02-17-1.13.0.md +29 -0
  46. data/gh-pages/_posts/2013-02-17-1.14.0.md +15 -0
  47. data/gh-pages/_posts/2013-02-17-1.14.1.md +18 -0
  48. data/gh-pages/_posts/2013-02-17-two-months-in.md +27 -0
  49. data/gh-pages/_posts/2013-03-16-1.15.0.md +28 -0
  50. data/gh-pages/_posts/2013-03-16-coloured-output-released.md +27 -0
  51. data/gh-pages/_posts/2013-04-10-ruby-2.0-compatibility.md +28 -0
  52. data/gh-pages/_posts/2013-04-11-1.15.1.md +13 -0
  53. data/gh-pages/_posts/2013-04-12-1.16.0.md +22 -0
  54. data/gh-pages/_posts/2013-04-14-1.17.0.md +15 -0
  55. data/gh-pages/_posts/2013-04-14-1.17.1.md +20 -0
  56. data/gh-pages/_posts/2013-04-14-1.17.2.md +13 -0
  57. data/gh-pages/_posts/2013-04-15-sync-alias.md +31 -0
  58. data/gh-pages/_posts/2013-04-15-utf8-fixed-and-more.md +37 -0
  59. data/gh-pages/_posts/2013-04-16-1.18.0.md +15 -0
  60. data/gh-pages/_posts/2013-04-16-set-up-color-output.md +47 -0
  61. data/gh-pages/_posts/2013-04-19-1.19.0.md +13 -0
  62. data/gh-pages/_posts/2013-04-19-1.20.0.md +15 -0
  63. data/gh-pages/_posts/2013-04-20-1.21.0.md +16 -0
  64. data/gh-pages/_posts/2013-04-20-1.22.0.md +14 -0
  65. data/gh-pages/_posts/2013-04-20-1.22.1.md +13 -0
  66. data/gh-pages/_posts/2013-04-21-1.22.2.md +15 -0
  67. data/gh-pages/_posts/2013-04-21-1.23.0.md +35 -0
  68. data/gh-pages/_posts/2013-04-23-1.24.0.md +16 -0
  69. data/gh-pages/_posts/2013-04-24-1.25.0.md +21 -0
  70. data/gh-pages/_posts/2013-05-09-2.0.0.md +33 -0
  71. data/gh-pages/_posts/2013-05-09-version-2.0.0-released.md +32 -0
  72. data/gh-pages/_posts/2013-07-20-2.1.0.md +36 -0
  73. data/gh-pages/_posts/2013-07-20-2.2.0.md +20 -0
  74. data/gh-pages/_posts/2013-10-12-2.3.0.md +19 -0
  75. data/gh-pages/_posts/2014-03-30-2.3.1.md +25 -0
  76. data/gh-pages/_posts/2015-01-05-2.3.2.md +18 -0
  77. data/gh-pages/_posts/2015-12-03-get-involved.md +29 -0
  78. data/gh-pages/_posts/2015-12-05-2.3.3.md +16 -0
  79. data/gh-pages/_posts/2016-01-02-2.4.0.md +19 -0
  80. data/gh-pages/_posts/2017-05-01-2.4.1.md +12 -0
  81. data/gh-pages/_posts/2017-10-23-sleep-mode.md +18 -0
  82. data/gh-pages/_posts/2018-01-03-3.0.1.md +12 -0
  83. data/gh-pages/_stylesheets/ppl/color.less +119 -0
  84. data/gh-pages/_stylesheets/ppl/layout.less +54 -0
  85. data/gh-pages/_stylesheets/ppl/style.less +185 -0
  86. data/gh-pages/_stylesheets/ppl/typography.less +59 -0
  87. data/gh-pages/development/changelog/index.md +18 -0
  88. data/gh-pages/development/changelog/split.rb +51 -0
  89. data/gh-pages/development/index.html +32 -0
  90. data/gh-pages/development/roadmap/index.md +15 -0
  91. data/gh-pages/documentation/about/index.html +63 -0
  92. data/gh-pages/documentation/commands/add/index.md +43 -0
  93. data/gh-pages/documentation/commands/age/add/index.md +40 -0
  94. data/gh-pages/documentation/commands/age/index.md +38 -0
  95. data/gh-pages/documentation/commands/bday/index.md +44 -0
  96. data/gh-pages/documentation/commands/completion/index.md +38 -0
  97. data/gh-pages/documentation/commands/email/index.md +64 -0
  98. data/gh-pages/documentation/commands/grep/index.md +32 -0
  99. data/gh-pages/documentation/commands/init/index.md +28 -0
  100. data/gh-pages/documentation/commands/ls/index.md +55 -0
  101. data/gh-pages/documentation/commands/mutt/index.md +36 -0
  102. data/gh-pages/documentation/commands/mv/index.md +26 -0
  103. data/gh-pages/documentation/commands/name/index.md +45 -0
  104. data/gh-pages/documentation/commands/nick/index.md +44 -0
  105. data/gh-pages/documentation/commands/org/index.md +45 -0
  106. data/gh-pages/documentation/commands/phone/index.md +56 -0
  107. data/gh-pages/documentation/commands/post/index.md +61 -0
  108. data/gh-pages/documentation/commands/pull/index.md +39 -0
  109. data/gh-pages/documentation/commands/push/index.md +36 -0
  110. data/gh-pages/documentation/commands/remote/index.md +40 -0
  111. data/gh-pages/documentation/commands/rm/index.md +23 -0
  112. data/gh-pages/documentation/commands/scrape/index.md +38 -0
  113. data/gh-pages/documentation/commands/shell/index.md +39 -0
  114. data/gh-pages/documentation/commands/show/index.md +33 -0
  115. data/gh-pages/documentation/commands/url/index.md +44 -0
  116. data/gh-pages/documentation/commands/version/index.md +27 -0
  117. data/gh-pages/documentation/configuration/address_book/index.md +22 -0
  118. data/gh-pages/documentation/configuration/alias/index.md +45 -0
  119. data/gh-pages/documentation/configuration/color/index.md +47 -0
  120. data/gh-pages/documentation/configuration/color_age/index.md +20 -0
  121. data/gh-pages/documentation/configuration/color_bday/index.md +20 -0
  122. data/gh-pages/documentation/configuration/color_email/index.md +21 -0
  123. data/gh-pages/documentation/configuration/color_ls/index.md +21 -0
  124. data/gh-pages/documentation/configuration/color_name/index.md +20 -0
  125. data/gh-pages/documentation/configuration/color_nick/index.md +20 -0
  126. data/gh-pages/documentation/configuration/color_org/index.md +20 -0
  127. data/gh-pages/documentation/configuration/color_phone/index.md +22 -0
  128. data/gh-pages/documentation/configuration/color_post/index.md +20 -0
  129. data/gh-pages/documentation/configuration/color_url/index.md +20 -0
  130. data/gh-pages/documentation/configuration/index.html +8 -0
  131. data/gh-pages/documentation/index.html +183 -0
  132. data/gh-pages/documentation/integration/bash/index.md +23 -0
  133. data/gh-pages/documentation/integration/google/index.md +26 -0
  134. data/gh-pages/documentation/integration/index.html +8 -0
  135. data/gh-pages/documentation/integration/mutt/index.md +35 -0
  136. data/gh-pages/documentation/integration/zsh/index.md +19 -0
  137. data/gh-pages/documentation/quick-start/index.html +88 -0
  138. data/gh-pages/documentation/tips/index.html +9 -0
  139. data/gh-pages/index.html +108 -0
  140. data/gh-pages/news/index.html +9 -0
  141. data/gh-pages/robots.txt +3 -0
  142. data/gh-pages/stylesheets/flatstrap.css +10 -0
  143. data/gh-pages/stylesheets/ppl.scss +235 -0
  144. data/gh-pages/wiki.png +0 -0
  145. data/lib/ppl.rb +4 -1
  146. data/lib/ppl/adapter/color.rb +0 -1
  147. data/lib/ppl/adapter/color/colored.rb +0 -1
  148. data/lib/ppl/adapter/email_scraper.rb +0 -1
  149. data/lib/ppl/adapter/email_scraper/mail.rb +4 -5
  150. data/lib/ppl/adapter/storage.rb +0 -1
  151. data/lib/ppl/adapter/storage/disk.rb +0 -1
  152. data/lib/ppl/adapter/storage/factory.rb +0 -1
  153. data/lib/ppl/adapter/vcard.rb +0 -1
  154. data/lib/ppl/adapter/vcard/vpim.rb +5 -1
  155. data/lib/ppl/application/bootstrap.rb +0 -1
  156. data/lib/ppl/application/command.rb +0 -1
  157. data/lib/ppl/application/command_suite.rb +0 -1
  158. data/lib/ppl/application/configuration.rb +0 -1
  159. data/lib/ppl/application/input.rb +0 -1
  160. data/lib/ppl/application/output.rb +0 -1
  161. data/lib/ppl/application/router.rb +0 -1
  162. data/lib/ppl/application/shell.rb +0 -1
  163. data/lib/ppl/command/add.rb +0 -1
  164. data/lib/ppl/command/age.rb +0 -1
  165. data/lib/ppl/command/attribute.rb +0 -1
  166. data/lib/ppl/command/bday.rb +0 -1
  167. data/lib/ppl/command/completion.rb +0 -1
  168. data/lib/ppl/command/email.rb +0 -1
  169. data/lib/ppl/command/external.rb +0 -1
  170. data/lib/ppl/command/help.rb +0 -1
  171. data/lib/ppl/command/init.rb +0 -1
  172. data/lib/ppl/command/ls.rb +0 -1
  173. data/lib/ppl/command/mutt.rb +0 -1
  174. data/lib/ppl/command/mv.rb +0 -1
  175. data/lib/ppl/command/name.rb +0 -1
  176. data/lib/ppl/command/nick.rb +0 -1
  177. data/lib/ppl/command/org.rb +0 -1
  178. data/lib/ppl/command/phone.rb +0 -1
  179. data/lib/ppl/command/post.rb +0 -1
  180. data/lib/ppl/command/rm.rb +0 -1
  181. data/lib/ppl/command/scrape.rb +0 -1
  182. data/lib/ppl/command/shell.rb +0 -1
  183. data/lib/ppl/command/show.rb +0 -1
  184. data/lib/ppl/command/url.rb +0 -1
  185. data/lib/ppl/command/version.rb +0 -1
  186. data/lib/ppl/entity/address_book.rb +0 -1
  187. data/lib/ppl/entity/contact.rb +0 -1
  188. data/lib/ppl/entity/email_address.rb +0 -1
  189. data/lib/ppl/entity/name.rb +0 -1
  190. data/lib/ppl/entity/phone_number.rb +0 -1
  191. data/lib/ppl/entity/postal_address.rb +0 -1
  192. data/lib/ppl/error/completion_not_found.rb +0 -1
  193. data/lib/ppl/error/contact_not_found.rb +0 -1
  194. data/lib/ppl/error/incorrect_usage.rb +0 -1
  195. data/lib/ppl/error/invalid_vcard.rb +1 -0
  196. data/lib/ppl/error/postal_address_not_found.rb +0 -1
  197. data/lib/ppl/format/address_book.rb +0 -1
  198. data/lib/ppl/format/address_book/ages.rb +0 -1
  199. data/lib/ppl/format/address_book/birthdays.rb +0 -1
  200. data/lib/ppl/format/address_book/email_addresses.rb +0 -1
  201. data/lib/ppl/format/address_book/mutt_query.rb +0 -1
  202. data/lib/ppl/format/address_book/names.rb +0 -1
  203. data/lib/ppl/format/address_book/nicknames.rb +0 -1
  204. data/lib/ppl/format/address_book/one_line.rb +0 -1
  205. data/lib/ppl/format/address_book/organizations.rb +0 -1
  206. data/lib/ppl/format/address_book/phone_numbers.rb +0 -1
  207. data/lib/ppl/format/address_book/postal_addresses.rb +0 -1
  208. data/lib/ppl/format/address_book/urls.rb +0 -1
  209. data/lib/ppl/format/contact.rb +0 -1
  210. data/lib/ppl/format/contact/age.rb +0 -1
  211. data/lib/ppl/format/contact/birthday.rb +0 -1
  212. data/lib/ppl/format/contact/email_addresses.rb +0 -1
  213. data/lib/ppl/format/contact/full.rb +0 -1
  214. data/lib/ppl/format/contact/nicknames.rb +0 -1
  215. data/lib/ppl/format/contact/organization.rb +0 -1
  216. data/lib/ppl/format/contact/phone_number.rb +0 -1
  217. data/lib/ppl/format/contact/postal_address.rb +0 -1
  218. data/lib/ppl/format/contact/postal_addresses.rb +0 -1
  219. data/lib/ppl/format/contact/urls.rb +0 -1
  220. data/lib/ppl/format/custom.rb +0 -1
  221. data/lib/ppl/format/custom/contact.rb +0 -1
  222. data/lib/ppl/format/custom/email_address.rb +0 -1
  223. data/lib/ppl/format/custom/phone_number.rb +0 -1
  224. data/lib/ppl/format/name.rb +0 -1
  225. data/lib/ppl/format/name/full_only.rb +0 -1
  226. data/lib/ppl/format/postal_address.rb +0 -1
  227. data/lib/ppl/format/postal_address/multi_line.rb +0 -1
  228. data/lib/ppl/format/postal_address/one_line.rb +0 -1
  229. data/lib/ppl/format/table.rb +0 -1
  230. data/lib/ppl/service/email_address.rb +0 -1
  231. data/lib/ppl/service/name.rb +0 -1
  232. data/lib/ppl/service/phone_number.rb +0 -1
  233. data/lib/ppl/service/postal_address.rb +0 -1
  234. data/{LICENSE → license} +0 -0
  235. data/makefile +18 -0
  236. data/package.json +23 -0
  237. data/ppl.gemspec +15 -13
  238. data/{README.md → readme.md} +12 -9
  239. data/site/_data/url.js +4 -0
  240. data/site/casts/hero.cast +189 -0
  241. data/site/development.njk +6 -0
  242. data/site/documentation.njk +6 -0
  243. data/site/index.njk +75 -0
  244. data/site/news.njk +6 -0
  245. data/site/style.scss +140 -0
  246. data/spec/ppl/adapter/color/colored_spec.rb +3 -4
  247. data/spec/ppl/adapter/color_spec.rb +0 -1
  248. data/spec/ppl/adapter/email_scraper/mail_spec.rb +13 -13
  249. data/spec/ppl/adapter/email_scraper_spec.rb +0 -1
  250. data/spec/ppl/adapter/output_spec.rb +7 -8
  251. data/spec/ppl/adapter/storage/disk_spec.rb +18 -19
  252. data/spec/ppl/adapter/storage/factory_spec.rb +3 -4
  253. data/spec/ppl/adapter/storage/git_spec.rb +31 -32
  254. data/spec/ppl/adapter/storage_spec.rb +3 -4
  255. data/spec/ppl/adapter/vcard/greencard_spec.rb +45 -45
  256. data/spec/ppl/adapter/vcard_spec.rb +0 -1
  257. data/spec/ppl/application/bootstrap_spec.rb +128 -129
  258. data/spec/ppl/application/command_spec.rb +8 -9
  259. data/spec/ppl/application/command_suite_spec.rb +7 -8
  260. data/spec/ppl/application/configuration_spec.rb +16 -17
  261. data/spec/ppl/application/input_spec.rb +2 -3
  262. data/spec/ppl/application/router_spec.rb +8 -9
  263. data/spec/ppl/application/shell_spec.rb +39 -40
  264. data/spec/ppl/command/add_spec.rb +6 -7
  265. data/spec/ppl/command/age_spec.rb +7 -8
  266. data/spec/ppl/command/attribute_spec.rb +22 -23
  267. data/spec/ppl/command/bday_spec.rb +11 -12
  268. data/spec/ppl/command/completion_spec.rb +7 -8
  269. data/spec/ppl/command/email_spec.rb +19 -20
  270. data/spec/ppl/command/external_spec.rb +7 -8
  271. data/spec/ppl/command/help_spec.rb +15 -16
  272. data/spec/ppl/command/init_spec.rb +5 -6
  273. data/spec/ppl/command/ls_spec.rb +12 -13
  274. data/spec/ppl/command/mutt_spec.rb +33 -34
  275. data/spec/ppl/command/mv_spec.rb +11 -12
  276. data/spec/ppl/command/name_spec.rb +17 -18
  277. data/spec/ppl/command/nick_spec.rb +1 -2
  278. data/spec/ppl/command/org_spec.rb +1 -2
  279. data/spec/ppl/command/phone_spec.rb +15 -16
  280. data/spec/ppl/command/post_spec.rb +29 -30
  281. data/spec/ppl/command/rm_spec.rb +3 -4
  282. data/spec/ppl/command/scrape_spec.rb +24 -25
  283. data/spec/ppl/command/shell_spec.rb +41 -42
  284. data/spec/ppl/command/show_spec.rb +4 -5
  285. data/spec/ppl/command/url_spec.rb +1 -2
  286. data/spec/ppl/command/version_spec.rb +4 -5
  287. data/spec/ppl/entity/address_book_spec.rb +1 -2
  288. data/spec/ppl/entity/contact_spec.rb +16 -17
  289. data/spec/ppl/entity/email_address_spec.rb +3 -4
  290. data/spec/ppl/entity/name_spec.rb +1 -2
  291. data/spec/ppl/entity/phone_number_spec.rb +5 -6
  292. data/spec/ppl/entity/postal_address_spec.rb +2 -3
  293. data/spec/ppl/format/address_book/ages_spec.rb +3 -4
  294. data/spec/ppl/format/address_book/birthdays_spec.rb +3 -4
  295. data/spec/ppl/format/address_book/email_addresses_spec.rb +3 -4
  296. data/spec/ppl/format/address_book/mutt_query_spec.rb +3 -4
  297. data/spec/ppl/format/address_book/names_spec.rb +3 -4
  298. data/spec/ppl/format/address_book/nicknames_spec.rb +4 -5
  299. data/spec/ppl/format/address_book/one_line_spec.rb +5 -6
  300. data/spec/ppl/format/address_book/organizations_spec.rb +3 -4
  301. data/spec/ppl/format/address_book/phone_numbers_spec.rb +3 -4
  302. data/spec/ppl/format/address_book/postal_addresses_spec.rb +2 -3
  303. data/spec/ppl/format/address_book/urls_spec.rb +3 -4
  304. data/spec/ppl/format/address_book_spec.rb +0 -1
  305. data/spec/ppl/format/contact/age_spec.rb +8 -9
  306. data/spec/ppl/format/contact/birthday_spec.rb +4 -5
  307. data/spec/ppl/format/contact/email_addresses_spec.rb +3 -4
  308. data/spec/ppl/format/contact/full_spec.rb +11 -12
  309. data/spec/ppl/format/contact/nicknames_spec.rb +4 -5
  310. data/spec/ppl/format/contact/organization_spec.rb +4 -5
  311. data/spec/ppl/format/contact/phone_number_spec.rb +4 -5
  312. data/spec/ppl/format/contact/postal_address_spec.rb +1 -2
  313. data/spec/ppl/format/contact/postal_addresses_spec.rb +3 -4
  314. data/spec/ppl/format/contact/urls_spec.rb +4 -5
  315. data/spec/ppl/format/contact_spec.rb +0 -1
  316. data/spec/ppl/format/custom/contact_spec.rb +13 -14
  317. data/spec/ppl/format/custom/email_address_spec.rb +3 -4
  318. data/spec/ppl/format/custom/phone_number_spec.rb +4 -5
  319. data/spec/ppl/format/custom_spec.rb +6 -7
  320. data/spec/ppl/format/name/full_only_spec.rb +4 -5
  321. data/spec/ppl/format/name_spec.rb +0 -1
  322. data/spec/ppl/format/postal_address/multi_line_spec.rb +10 -11
  323. data/spec/ppl/format/postal_address/one_line_spec.rb +9 -10
  324. data/spec/ppl/format/postal_address_spec.rb +0 -1
  325. data/spec/ppl/format/table_spec.rb +11 -11
  326. data/spec/ppl/service/email_address_spec.rb +13 -14
  327. data/spec/ppl/service/name_spec.rb +9 -10
  328. data/spec/ppl/service/phone_number_spec.rb +11 -12
  329. data/spec/ppl/service/postal_address_spec.rb +20 -21
  330. data/spec/spec_helper.rb +4 -0
  331. data/yarn.lock +3605 -0
  332. metadata +183 -22
  333. data/.travis.yml +0 -11
  334. data/COPYING +0 -339
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Command::Age do
3
2
 
4
3
  before(:each) do
@@ -16,24 +15,24 @@ describe Ppl::Command::Age do
16
15
 
17
16
  describe "#name" do
18
17
  it "should be 'age'" do
19
- @command.name.should eq "age"
18
+ expect(@command.name).to eq "age"
20
19
  end
21
20
  end
22
21
 
23
22
  describe "#execute" do
24
23
 
25
24
  it "should list contacts' ages if no arguments are given" do
26
- @storage.should_receive(:load_address_book)
27
- @list_format.should_receive(:process)
28
- @output.should_receive(:line)
25
+ expect(@storage).to receive(:load_address_book)
26
+ expect(@list_format).to receive(:process)
27
+ expect(@output).to receive(:line)
29
28
  @command.execute(@input, @output)
30
29
  end
31
30
 
32
31
  it "should show a single contact's ages if one is specified" do
33
32
  @input.arguments = ["jdoe"]
34
- @storage.should_receive(:require_contact)
35
- @show_format.should_receive(:process)
36
- @output.should_receive(:line)
33
+ expect(@storage).to receive(:require_contact)
34
+ expect(@show_format).to receive(:process)
35
+ expect(@output).to receive(:line)
37
36
  @command.execute(@input, @output)
38
37
  end
39
38
 
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Command::Attribute do
3
2
 
4
3
  before(:each) do
@@ -22,47 +21,47 @@ describe Ppl::Command::Attribute do
22
21
  describe "#execute" do
23
22
 
24
23
  it "should list all the contacts and the value of the attribute for each" do
25
- @storage.should_receive(:load_address_book).and_return(@address_book)
26
- @list_format.should_receive(:process).and_return("imagine this is a list")
27
- @output.should_receive(:line).with("imagine this is a list")
28
- @command.execute(@input, @output).should eq true
24
+ expect(@storage).to receive(:load_address_book).and_return(@address_book)
25
+ expect(@list_format).to receive(:process).and_return("imagine this is a list")
26
+ expect(@output).to receive(:line).with("imagine this is a list")
27
+ expect(@command.execute(@input, @output)).to eq true
29
28
  end
30
29
 
31
30
  it "should disable color output if :no_color is set" do
32
31
  @input.options[:no_color] = true
33
- @storage.stub(:load_address_book).and_return(@address_book)
34
- @list_format.should_receive(:disable_colors!)
35
- @list_format.stub(:process)
36
- @output.should_receive(:line)
37
- @command.execute(@input, @output).should eq true
32
+ allow(@storage).to receive(:load_address_book).and_return(@address_book)
33
+ expect(@list_format).to receive(:disable_colors!)
34
+ allow(@list_format).to receive(:process)
35
+ expect(@output).to receive(:line)
36
+ expect(@command.execute(@input, @output)).to eq true
38
37
  end
39
38
 
40
39
  it "should show the full list of attributes for the given contact" do
41
40
  @input.arguments.push("jdoe")
42
- @storage.should_receive(:require_contact).and_return(@contact)
43
- @show_format.should_receive(:process).and_return("all the info")
44
- @output.should_receive(:line).with("all the info")
45
- @command.execute(@input, @output).should eq true
41
+ expect(@storage).to receive(:require_contact).and_return(@contact)
42
+ expect(@show_format).to receive(:process).and_return("all the info")
43
+ expect(@output).to receive(:line).with("all the info")
44
+ expect(@command.execute(@input, @output)).to eq true
46
45
  end
47
46
 
48
47
  it "should add the given value to the contact's attributes" do
49
48
  @input.arguments.push("jdoe", "anyvalue")
50
- @storage.should_receive(:require_contact).and_return(@contact)
51
- @contact.should_receive(:phone_numbers).and_return([])
52
- @storage.should_receive(:save_contact)
53
- @command.execute(@input, @output).should eq true
49
+ expect(@storage).to receive(:require_contact).and_return(@contact)
50
+ expect(@contact).to receive(:phone_numbers).and_return([])
51
+ expect(@storage).to receive(:save_contact)
52
+ expect(@command.execute(@input, @output)).to eq true
54
53
  end
55
54
 
56
55
  it "should delete the given value from the contact's attributes" do
57
56
  phone_numbers = double(Array)
58
- phone_numbers.should_receive(:delete)
57
+ expect(phone_numbers).to receive(:delete)
59
58
 
60
- @storage.should_receive(:require_contact).and_return(@contact)
61
- @contact.should_receive(:phone_numbers).and_return(phone_numbers)
62
- @storage.should_receive(:save_contact).and_return(true)
59
+ expect(@storage).to receive(:require_contact).and_return(@contact)
60
+ expect(@contact).to receive(:phone_numbers).and_return(phone_numbers)
61
+ expect(@storage).to receive(:save_contact).and_return(true)
63
62
  @input.arguments = ["jdoe", "somevalue"]
64
63
  @input.options = { :delete => true }
65
- @command.execute(@input, @output).should eq true
64
+ expect(@command.execute(@input, @output)).to eq true
66
65
  end
67
66
 
68
67
  end
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Command::Bday do
3
2
 
4
3
  before(:each) do
@@ -16,31 +15,31 @@ describe Ppl::Command::Bday do
16
15
 
17
16
  describe "#name" do
18
17
  it "should be 'bday'" do
19
- @command.name.should eq "bday"
18
+ expect(@command.name).to eq "bday"
20
19
  end
21
20
  end
22
21
 
23
22
  describe "#execute" do
24
23
 
25
24
  it "should show the contact's birthday if no date is given" do
26
- @storage.should_receive(:require_contact).and_return(@contact)
27
- @show_format.should_receive(:process).and_return("1970-01-01")
28
- @output.should_receive(:line).with("1970-01-01")
25
+ expect(@storage).to receive(:require_contact).and_return(@contact)
26
+ expect(@show_format).to receive(:process).and_return("1970-01-01")
27
+ expect(@output).to receive(:line).with("1970-01-01")
29
28
  @input.arguments = ["jim"]
30
- @command.execute(@input, @output).should eq true
29
+ expect(@command.execute(@input, @output)).to eq true
31
30
  end
32
31
 
33
32
  it "should not output anything if there's no birthday to show" do
34
- @storage.should_receive(:require_contact).and_return(@contact)
35
- @show_format.should_receive(:process).and_return("")
33
+ expect(@storage).to receive(:require_contact).and_return(@contact)
34
+ expect(@show_format).to receive(:process).and_return("")
36
35
  @input.arguments = ["jim"]
37
- @command.execute(@input, @output).should eq false
36
+ expect(@command.execute(@input, @output)).to eq false
38
37
  end
39
38
 
40
39
  it "should change the contact's birthday if a date is given" do
41
- @storage.should_receive(:require_contact).and_return(@contact)
42
- @storage.should_receive(:save_contact) do |contact|
43
- contact.birthday.strftime.should eq "1980-01-01"
40
+ expect(@storage).to receive(:require_contact).and_return(@contact)
41
+ expect(@storage).to receive(:save_contact) do |contact|
42
+ expect(contact.birthday.strftime).to eq "1980-01-01"
44
43
  end
45
44
  @input.arguments = ["jim", "1980-01-01"]
46
45
  @command.execute(@input, @output)
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Command::Completion do
3
2
 
4
3
  before(:each) do
@@ -11,16 +10,16 @@ describe Ppl::Command::Completion do
11
10
 
12
11
  describe "#name" do
13
12
  it "should be 'completion'" do
14
- @command.name.should eq "completion"
13
+ expect(@command.name).to eq "completion"
15
14
  end
16
15
  end
17
16
 
18
17
  describe "#execute" do
19
18
 
20
19
  before(:each) do
21
- @directory.stub(:path).and_return("")
22
- File.stub(:exists?).and_return(true)
23
- File.stub(:read)
20
+ allow(@directory).to receive(:path).and_return("")
21
+ allow(File).to receive(:exists?).and_return(true)
22
+ allow(File).to receive(:read)
24
23
  end
25
24
 
26
25
  it "should raise an error if no shell is specified" do
@@ -30,14 +29,14 @@ describe Ppl::Command::Completion do
30
29
 
31
30
  it "should raise an error if the shell is not recognised" do
32
31
  @input.arguments = ["invalidshell"]
33
- File.should_receive(:exists?).with("/invalidshell").and_return(false)
32
+ expect(File).to receive(:exists?).with("/invalidshell").and_return(false)
34
33
  expect{@command.execute(@input, @output)}.to raise_error(Ppl::Error::CompletionNotFound)
35
34
  end
36
35
 
37
36
  it "should read the function from disk and print it to stdout" do
38
37
  @input.arguments = ["zsh"]
39
- File.should_receive(:read).and_return("completion function")
40
- @output.should_receive(:line).with("completion function")
38
+ expect(File).to receive(:read).and_return("completion function")
39
+ expect(@output).to receive(:line).with("completion function")
41
40
  @command.execute(@input, @output)
42
41
  end
43
42
 
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Command::Email do
3
2
 
4
3
  before(:each) do
@@ -7,7 +6,7 @@ describe Ppl::Command::Email do
7
6
 
8
7
  describe "#name" do
9
8
  it "should be 'email'" do
10
- @command.name.should eq "email"
9
+ expect(@command.name).to eq "email"
11
10
  end
12
11
  end
13
12
 
@@ -22,8 +21,8 @@ describe Ppl::Command::Email do
22
21
  @list_format = double(Ppl::Format::AddressBook)
23
22
  @show_format = double(Ppl::Format::Contact)
24
23
  @custom_format = double(Ppl::Format::Custom)
25
- @storage.stub(:require_contact).and_return(@contact)
26
- @storage.stub(:save_contact)
24
+ allow(@storage).to receive(:require_contact).and_return(@contact)
25
+ allow(@storage).to receive(:save_contact)
27
26
  @command.storage = @storage
28
27
  @command.email_service = @service
29
28
  @command.list_format = @list_format
@@ -32,17 +31,17 @@ describe Ppl::Command::Email do
32
31
  end
33
32
 
34
33
  it "should list all email addresses by default" do
35
- @storage.should_receive(:load_address_book).and_return(@address_book)
36
- @list_format.should_receive(:process).and_return("imagine this is a list")
37
- @output.should_receive(:line).with("imagine this is a list")
34
+ expect(@storage).to receive(:load_address_book).and_return(@address_book)
35
+ expect(@list_format).to receive(:process).and_return("imagine this is a list")
36
+ expect(@output).to receive(:line).with("imagine this is a list")
38
37
  @command.execute(@input, @output)
39
38
  end
40
39
 
41
40
  it "should show a single contact's addresses if one is specified" do
42
41
  @input.arguments << "jdoe"
43
- @storage.should_receive(:require_contact).and_return(@contact)
44
- @show_format.should_receive(:process).and_return("imagine this is a list")
45
- @output.should_receive(:line).with("imagine this is a list")
42
+ expect(@storage).to receive(:require_contact).and_return(@contact)
43
+ expect(@show_format).to receive(:process).and_return("imagine this is a list")
44
+ expect(@output).to receive(:line).with("imagine this is a list")
46
45
  @command.execute(@input, @output)
47
46
  end
48
47
 
@@ -50,33 +49,33 @@ describe Ppl::Command::Email do
50
49
  @input.arguments << "jdoe"
51
50
  @input.options[:format] = "%e"
52
51
  @contact.email_addresses << Ppl::Entity::EmailAddress.new("jdoe@example.org")
53
- @storage.should_receive(:require_contact).and_return(@contact)
54
- @custom_format.should_receive(:format=).with("%e")
55
- @custom_format.should_receive(:process).and_return("")
56
- @output.should_receive(:line).with("")
52
+ expect(@storage).to receive(:require_contact).and_return(@contact)
53
+ expect(@custom_format).to receive(:format=).with("%e")
54
+ expect(@custom_format).to receive(:process).and_return("")
55
+ expect(@output).to receive(:line).with("")
57
56
  @command.execute(@input, @output)
58
57
  end
59
58
 
60
59
  it "should delegate to the service layer to add a new email address" do
61
60
  @input.arguments = ["jdoe", "jdoe@example.org"]
62
- @storage.should_receive(:require_contact).and_return(@contact)
63
- @service.should_receive(:add).with(@contact, "jdoe@example.org", @input.options)
61
+ expect(@storage).to receive(:require_contact).and_return(@contact)
62
+ expect(@service).to receive(:add).with(@contact, "jdoe@example.org", @input.options)
64
63
  @command.execute(@input, @output)
65
64
  end
66
65
 
67
66
  it "should delegate to the service layer to update an existing address" do
68
67
  @contact.email_addresses << Ppl::Entity::EmailAddress.new("jdoe@example.org")
69
68
  @input.arguments = ["jdoe", "jdoe@example.org"]
70
- @storage.should_receive(:require_contact).and_return(@contact)
71
- @service.should_receive(:update).with(@contact, "jdoe@example.org", {})
69
+ expect(@storage).to receive(:require_contact).and_return(@contact)
70
+ expect(@service).to receive(:update).with(@contact, "jdoe@example.org", {})
72
71
  @command.execute(@input, @output)
73
72
  end
74
73
 
75
74
  it "should delegate to the service layer to remove an email address" do
76
75
  @input.arguments = ["jdoe", "jdoe@example.org"]
77
76
  @input.options[:delete] = true
78
- @storage.should_receive(:require_contact).and_return(@contact)
79
- @service.should_receive(:remove).with(@contact, "jdoe@example.org")
77
+ expect(@storage).to receive(:require_contact).and_return(@contact)
78
+ expect(@service).to receive(:remove).with(@contact, "jdoe@example.org")
80
79
  @command.execute(@input, @output)
81
80
  end
82
81
 
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Command::External do
3
2
 
4
3
  before(:each) do
@@ -7,28 +6,28 @@ describe Ppl::Command::External do
7
6
  @output = double(Ppl::Application::Output)
8
7
  @storage = double(Ppl::Adapter::Storage)
9
8
 
10
- @storage.stub(:path).and_return("/contacts")
9
+ allow(@storage).to receive(:path).and_return("/contacts")
11
10
  @command.storage = @storage
12
11
  end
13
12
 
14
13
  describe "#execute" do
15
14
 
16
15
  it "should chdir to the location of the address book on disk" do
17
- Dir.should_receive(:chdir).with("/contacts")
18
- Kernel.stub(:exec)
16
+ expect(Dir).to receive(:chdir).with("/contacts")
17
+ allow(Kernel).to receive(:exec)
19
18
  @command.execute(@input, @output)
20
19
  end
21
20
 
22
21
  it "should run the specified command" do
23
- Dir.stub(:chdir)
24
- Kernel.should_receive(:exec).with("git remote")
22
+ allow(Dir).to receive(:chdir)
23
+ expect(Kernel).to receive(:exec).with("git remote")
25
24
  @command.execute(@input, @output)
26
25
  end
27
26
 
28
27
  it "should pass arguments through to the command" do
29
28
  @input.arguments = ["--help"]
30
- Dir.stub(:chdir)
31
- Kernel.should_receive(:exec).with("git remote --help")
29
+ allow(Dir).to receive(:chdir)
30
+ expect(Kernel).to receive(:exec).with("git remote --help")
32
31
  @command.execute(@input, @output)
33
32
  end
34
33
 
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Command::Help do
3
2
 
4
3
  before(:each) do
@@ -12,13 +11,13 @@ describe Ppl::Command::Help do
12
11
  it "should accept a value" do
13
12
  suite = Object.new
14
13
  @command.command_suite = suite
15
- @command.command_suite.should be suite
14
+ expect(@command.command_suite).to be suite
16
15
  end
17
16
  end
18
17
 
19
18
  describe "#name" do
20
19
  it "should be 'help'" do
21
- @command.name.should eq "help"
20
+ expect(@command.name).to eq "help"
22
21
  end
23
22
  end
24
23
 
@@ -27,23 +26,23 @@ describe Ppl::Command::Help do
27
26
  it "should not list itself" do
28
27
  @command.command_suite.add_command(@command)
29
28
 
30
- @output.should_receive(:line).with("usage: ppl <command>")
31
- @output.should_receive(:line).with(nil)
32
- @output.should_receive(:line).with(nil)
29
+ expect(@output).to receive(:line).with("usage: ppl <command>")
30
+ expect(@output).to receive(:line).with(nil)
31
+ expect(@output).to receive(:line).with(nil)
33
32
 
34
33
  @command.execute(nil, @output)
35
34
  end
36
35
 
37
36
  it "should list available commands" do
38
37
  command = double(Ppl::Application::Command)
39
- command.should_receive(:name).twice.and_return("one")
40
- command.should_receive(:description).and_return("The first command")
38
+ expect(command).to receive(:name).twice.and_return("one")
39
+ expect(command).to receive(:description).and_return("The first command")
41
40
  @command.command_suite.add_command(command)
42
41
 
43
- @output.should_receive(:line).with("usage: ppl <command>")
44
- @output.should_receive(:line).with(nil)
45
- @output.should_receive(:line).with(" one The first command")
46
- @output.should_receive(:line).with(nil)
42
+ expect(@output).to receive(:line).with("usage: ppl <command>")
43
+ expect(@output).to receive(:line).with(nil)
44
+ expect(@output).to receive(:line).with(" one The first command")
45
+ expect(@output).to receive(:line).with(nil)
47
46
 
48
47
  @command.execute(nil, @output)
49
48
  end
@@ -60,15 +59,15 @@ describe Ppl::Command::Help do
60
59
  @command.command_suite.add_command(command_foo)
61
60
  @command.command_suite.add_command(command_bar)
62
61
 
63
- @output.should_receive(:line).with("usage: ppl <command>")
64
- @output.should_receive(:line).with(nil)
62
+ expect(@output).to receive(:line).with("usage: ppl <command>")
63
+ expect(@output).to receive(:line).with(nil)
65
64
  [
66
65
  " shortname This is a command with a short name",
67
66
  " veryverylongname This is a command with a longer name",
68
67
  ].each do |line|
69
- @output.should_receive(:line).with(line)
68
+ expect(@output).to receive(:line).with(line)
70
69
  end
71
- @output.should_receive(:line).with(nil)
70
+ expect(@output).to receive(:line).with(nil)
72
71
 
73
72
  @command.execute(nil, @output)
74
73
  end
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Command::Init do
3
2
 
4
3
  before(:each) do
@@ -9,15 +8,15 @@ describe Ppl::Command::Init do
9
8
 
10
9
  describe "#name" do
11
10
  it "should be 'init'" do
12
- @command.name.should eq "init"
11
+ expect(@command.name).to eq "init"
13
12
  end
14
13
  end
15
14
 
16
15
  describe "#execute" do
17
16
 
18
17
  it "should pass the given path through to the storage adapter" do
19
- Ppl::Adapter::Storage::Git.stub(:create_address_book) do |path|
20
- path.should eq "/contacts"
18
+ allow(Ppl::Adapter::Storage::Git).to receive(:create_address_book) do |path|
19
+ expect(path).to eq "/contacts"
21
20
  end
22
21
  @input.arguments.push "/contacts"
23
22
  @command.execute(@input, @output)
@@ -27,8 +26,8 @@ describe Ppl::Command::Init do
27
26
  FakeFS.activate!
28
27
  Dir.mkdir "/current"
29
28
  Dir.chdir "/current"
30
- Ppl::Adapter::Storage::Git.stub(:create_address_book) do |path|
31
- path.should eq "/current"
29
+ allow(Ppl::Adapter::Storage::Git).to receive(:create_address_book) do |path|
30
+ expect(path).to eq "/current"
32
31
  end
33
32
  @command.execute(@input, @output)
34
33
  FakeFS.deactivate!
@@ -1,4 +1,3 @@
1
-
2
1
  describe Ppl::Command::Ls do
3
2
 
4
3
  before(:each) do
@@ -17,14 +16,14 @@ describe Ppl::Command::Ls do
17
16
 
18
17
  describe "#name" do
19
18
  it "should be 'ls'" do
20
- @command.name.should eq "ls"
19
+ expect(@command.name).to eq "ls"
21
20
  end
22
21
  end
23
22
 
24
23
  describe "#execute" do
25
24
 
26
25
  before(:each) do
27
- @storage.should_receive(:load_address_book).and_return(@address_book)
26
+ expect(@storage).to receive(:load_address_book).and_return(@address_book)
28
27
  end
29
28
 
30
29
  after(:each) do
@@ -32,24 +31,24 @@ describe Ppl::Command::Ls do
32
31
  end
33
32
 
34
33
  it "should show the list of contacts in the address book" do
35
- @format.should_receive(:process).and_return("list of contacts")
36
- @output.should_receive(:line).with("list of contacts")
34
+ expect(@format).to receive(:process).and_return("list of contacts")
35
+ expect(@output).to receive(:line).with("list of contacts")
37
36
  end
38
37
 
39
38
  it "should let the user specify a preset pretty format" do
40
39
  @input.options[:pretty] = "test"
41
- @address_book.should_receive(:contacts).and_return([1])
42
- @custom.should_receive(:use_preset).with("test")
43
- @custom.should_receive(:process).and_return("list of contacts")
44
- @output.should_receive(:line).with("list of contacts")
40
+ expect(@address_book).to receive(:contacts).and_return([1])
41
+ expect(@custom).to receive(:use_preset).with("test")
42
+ expect(@custom).to receive(:process).and_return("list of contacts")
43
+ expect(@output).to receive(:line).with("list of contacts")
45
44
  end
46
45
 
47
46
  it "should let the user specify a custom format" do
48
47
  @input.options[:format] = "%n"
49
- @address_book.should_receive(:contacts).and_return([1])
50
- @custom.should_receive(:format=).with("%n")
51
- @custom.should_receive(:process).and_return("list of contacts")
52
- @output.should_receive(:line).with("list of contacts")
48
+ expect(@address_book).to receive(:contacts).and_return([1])
49
+ expect(@custom).to receive(:format=).with("%n")
50
+ expect(@custom).to receive(:process).and_return("list of contacts")
51
+ expect(@output).to receive(:line).with("list of contacts")
53
52
  end
54
53
 
55
54
  end