income-tax 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (396) hide show
  1. checksums.yaml +4 -4
  2. data/lib/income_tax/countries/austria.rb +13 -5
  3. data/lib/income_tax/countries/france.rb +9 -1
  4. data/lib/income_tax/countries/germany.rb +59 -18
  5. data/lib/income_tax/countries/germany/rates.tsv +10 -0
  6. data/lib/income_tax/countries/greece.rb +3 -2
  7. data/lib/income_tax/countries/singapore.rb +2 -11
  8. data/lib/income_tax/countries/switzerland/aargau.rb +1 -1
  9. data/lib/income_tax/countries/switzerland/appenzell_inner.rb +1 -1
  10. data/lib/income_tax/countries/switzerland/appenzell_outer.rb +1 -1
  11. data/lib/income_tax/countries/switzerland/basel_city.rb +1 -1
  12. data/lib/income_tax/countries/switzerland/basel_land.rb +1 -1
  13. data/lib/income_tax/countries/switzerland/bern.rb +1 -1
  14. data/lib/income_tax/countries/switzerland/data/aargau.dat +0 -0
  15. data/lib/income_tax/countries/switzerland/data/appenzell_inner.dat +0 -0
  16. data/lib/income_tax/countries/switzerland/data/appenzell_outer.dat +0 -0
  17. data/lib/income_tax/countries/switzerland/data/basel_city.dat +0 -0
  18. data/lib/income_tax/countries/switzerland/data/basel_land.dat +0 -0
  19. data/lib/income_tax/countries/switzerland/data/bern.dat +0 -0
  20. data/lib/income_tax/countries/switzerland/data/fribourg.dat +0 -0
  21. data/lib/income_tax/countries/switzerland/data/geneva.dat +0 -0
  22. data/lib/income_tax/countries/switzerland/data/glarus.dat +0 -0
  23. data/lib/income_tax/countries/switzerland/data/grisons.dat +0 -0
  24. data/lib/income_tax/countries/switzerland/data/jura.dat +0 -0
  25. data/lib/income_tax/countries/switzerland/data/lucerne.dat +0 -0
  26. data/lib/income_tax/countries/switzerland/data/neuchatel.dat +0 -0
  27. data/lib/income_tax/countries/switzerland/data/nidwalden.dat +0 -0
  28. data/lib/income_tax/countries/switzerland/data/obwalden.dat +0 -0
  29. data/lib/income_tax/countries/switzerland/data/schaffhausen.dat +0 -0
  30. data/lib/income_tax/countries/switzerland/data/schwyz.dat +0 -0
  31. data/lib/income_tax/countries/switzerland/data/solothurn.dat +0 -0
  32. data/lib/income_tax/countries/switzerland/data/st_gallen.dat +0 -0
  33. data/lib/income_tax/countries/switzerland/data/thurgau.dat +0 -0
  34. data/lib/income_tax/countries/switzerland/data/ticino.dat +0 -0
  35. data/lib/income_tax/countries/switzerland/data/uri.dat +0 -0
  36. data/lib/income_tax/countries/switzerland/data/valais.dat +0 -0
  37. data/lib/income_tax/countries/switzerland/data/vaud.dat +0 -0
  38. data/lib/income_tax/countries/switzerland/data/zug.dat +0 -0
  39. data/lib/income_tax/countries/switzerland/data/zurich.dat +0 -0
  40. data/lib/income_tax/countries/switzerland/fribourg.rb +1 -1
  41. data/lib/income_tax/countries/switzerland/geneva.rb +1 -1
  42. data/lib/income_tax/countries/switzerland/glarus.rb +1 -1
  43. data/lib/income_tax/countries/switzerland/grisons.rb +1 -1
  44. data/lib/income_tax/countries/switzerland/jura.rb +1 -1
  45. data/lib/income_tax/countries/switzerland/lucerne.rb +1 -1
  46. data/lib/income_tax/countries/switzerland/neuchatel.rb +1 -1
  47. data/lib/income_tax/countries/switzerland/nidwalden.rb +1 -1
  48. data/lib/income_tax/countries/switzerland/obwalden.rb +1 -1
  49. data/lib/income_tax/countries/switzerland/schaffhausen.rb +1 -1
  50. data/lib/income_tax/countries/switzerland/schwyz.rb +1 -1
  51. data/lib/income_tax/countries/switzerland/solothurn.rb +1 -1
  52. data/lib/income_tax/countries/switzerland/st_gallen.rb +1 -1
  53. data/lib/income_tax/countries/switzerland/thurgau.rb +1 -1
  54. data/lib/income_tax/countries/switzerland/ticino.rb +1 -1
  55. data/lib/income_tax/countries/switzerland/uri.rb +1 -1
  56. data/lib/income_tax/countries/switzerland/valais.rb +1 -1
  57. data/lib/income_tax/countries/switzerland/vaud.rb +1 -1
  58. data/lib/income_tax/countries/switzerland/zug.rb +1 -1
  59. data/lib/income_tax/countries/switzerland/zurich.rb +1 -1
  60. data/lib/income_tax/countries/united_kingdom.rb +12 -4
  61. data/lib/income_tax/models/generic.rb +5 -1
  62. data/lib/income_tax/models/progressive.rb +27 -5
  63. data/lib/income_tax/rate.rb +1 -0
  64. data/lib/income_tax/register.rb +6 -0
  65. data/lib/income_tax/version.rb +1 -1
  66. data/locations.md +250 -13
  67. data/readme.md +3 -2
  68. data/script/generate_switzerland.rb +10 -6
  69. data/spec/income_tax/countries/afghanistan_spec.rb +11 -1
  70. data/spec/income_tax/countries/aland_spec.rb +11 -1
  71. data/spec/income_tax/countries/albania_spec.rb +11 -1
  72. data/spec/income_tax/countries/algeria_spec.rb +11 -1
  73. data/spec/income_tax/countries/american_samoa_spec.rb +11 -1
  74. data/spec/income_tax/countries/andorra_spec.rb +11 -1
  75. data/spec/income_tax/countries/angola_spec.rb +11 -1
  76. data/spec/income_tax/countries/anguilla_spec.rb +11 -1
  77. data/spec/income_tax/countries/antigua_and_barbuda_spec.rb +11 -1
  78. data/spec/income_tax/countries/argentina_spec.rb +11 -1
  79. data/spec/income_tax/countries/armenia_spec.rb +11 -1
  80. data/spec/income_tax/countries/aruba_spec.rb +11 -1
  81. data/spec/income_tax/countries/australia_spec.rb +11 -1
  82. data/spec/income_tax/countries/austria_spec.rb +185 -74
  83. data/spec/income_tax/countries/azerbaijan_spec.rb +11 -1
  84. data/spec/income_tax/countries/bahamas_spec.rb +11 -1
  85. data/spec/income_tax/countries/bahrain_spec.rb +11 -1
  86. data/spec/income_tax/countries/bangladesh_spec.rb +11 -1
  87. data/spec/income_tax/countries/barbados_spec.rb +11 -1
  88. data/spec/income_tax/countries/belarus_spec.rb +11 -1
  89. data/spec/income_tax/countries/belgium_spec.rb +11 -1
  90. data/spec/income_tax/countries/belize_spec.rb +11 -1
  91. data/spec/income_tax/countries/benin_spec.rb +11 -1
  92. data/spec/income_tax/countries/bermuda_spec.rb +11 -1
  93. data/spec/income_tax/countries/bhutan_spec.rb +11 -1
  94. data/spec/income_tax/countries/bolivia_spec.rb +11 -1
  95. data/spec/income_tax/countries/bosnia_and_herzegovina_spec.rb +11 -1
  96. data/spec/income_tax/countries/botswana_spec.rb +11 -1
  97. data/spec/income_tax/countries/bouvet_island_spec.rb +11 -1
  98. data/spec/income_tax/countries/brazil_spec.rb +11 -1
  99. data/spec/income_tax/countries/british_indian_ocean_territory_spec.rb +35 -25
  100. data/spec/income_tax/countries/brunei_spec.rb +11 -1
  101. data/spec/income_tax/countries/bulgaria_spec.rb +11 -1
  102. data/spec/income_tax/countries/burkina_faso_spec.rb +11 -1
  103. data/spec/income_tax/countries/burundi_spec.rb +11 -1
  104. data/spec/income_tax/countries/cambodia_spec.rb +11 -1
  105. data/spec/income_tax/countries/cameroon_spec.rb +11 -1
  106. data/spec/income_tax/countries/canada_spec.rb +11 -1
  107. data/spec/income_tax/countries/cape_verde_spec.rb +11 -1
  108. data/spec/income_tax/countries/caribbean_netherlands_spec.rb +11 -1
  109. data/spec/income_tax/countries/cayman_islands_spec.rb +11 -1
  110. data/spec/income_tax/countries/central_african_republic_spec.rb +11 -1
  111. data/spec/income_tax/countries/chad_spec.rb +11 -1
  112. data/spec/income_tax/countries/chile_spec.rb +11 -1
  113. data/spec/income_tax/countries/china_spec.rb +11 -1
  114. data/spec/income_tax/countries/christmas_island_spec.rb +11 -1
  115. data/spec/income_tax/countries/cocos_keeling_islands_spec.rb +11 -1
  116. data/spec/income_tax/countries/colombia_spec.rb +11 -1
  117. data/spec/income_tax/countries/comoros_spec.rb +11 -1
  118. data/spec/income_tax/countries/congo_republic_spec.rb +11 -1
  119. data/spec/income_tax/countries/congo_spec.rb +11 -1
  120. data/spec/income_tax/countries/cook_islands_spec.rb +11 -1
  121. data/spec/income_tax/countries/costa_rica_spec.rb +11 -1
  122. data/spec/income_tax/countries/croatia_spec.rb +11 -1
  123. data/spec/income_tax/countries/cuba_spec.rb +11 -1
  124. data/spec/income_tax/countries/curacao_spec.rb +11 -1
  125. data/spec/income_tax/countries/cyprus_spec.rb +11 -1
  126. data/spec/income_tax/countries/czech_republic_spec.rb +11 -1
  127. data/spec/income_tax/countries/denmark_spec.rb +11 -1
  128. data/spec/income_tax/countries/djibouti_spec.rb +11 -1
  129. data/spec/income_tax/countries/dominica_spec.rb +11 -1
  130. data/spec/income_tax/countries/dominican_republic_spec.rb +11 -1
  131. data/spec/income_tax/countries/ecuador_spec.rb +11 -1
  132. data/spec/income_tax/countries/egypt_spec.rb +11 -1
  133. data/spec/income_tax/countries/el_salvador_spec.rb +11 -1
  134. data/spec/income_tax/countries/equatorial_guinea_spec.rb +11 -1
  135. data/spec/income_tax/countries/eritrea_spec.rb +11 -1
  136. data/spec/income_tax/countries/estonia_spec.rb +11 -1
  137. data/spec/income_tax/countries/ethiopia_spec.rb +11 -1
  138. data/spec/income_tax/countries/falkland_islands_spec.rb +11 -1
  139. data/spec/income_tax/countries/faroe_islands_spec.rb +11 -1
  140. data/spec/income_tax/countries/fiji_spec.rb +11 -1
  141. data/spec/income_tax/countries/finland_spec.rb +88 -75
  142. data/spec/income_tax/countries/france_spec.rb +185 -74
  143. data/spec/income_tax/countries/french_guiana_spec.rb +11 -1
  144. data/spec/income_tax/countries/french_polynesia_spec.rb +11 -1
  145. data/spec/income_tax/countries/french_southern_territories_spec.rb +11 -1
  146. data/spec/income_tax/countries/gabon_spec.rb +11 -1
  147. data/spec/income_tax/countries/gambia_spec.rb +11 -1
  148. data/spec/income_tax/countries/georgia_spec.rb +11 -1
  149. data/spec/income_tax/countries/germany_spec.rb +864 -67
  150. data/spec/income_tax/countries/ghana_spec.rb +11 -1
  151. data/spec/income_tax/countries/gibraltar_spec.rb +11 -1
  152. data/spec/income_tax/countries/greece_spec.rb +41 -31
  153. data/spec/income_tax/countries/greenland_spec.rb +11 -1
  154. data/spec/income_tax/countries/grenada_spec.rb +11 -1
  155. data/spec/income_tax/countries/guadeloupe_spec.rb +11 -1
  156. data/spec/income_tax/countries/guam_spec.rb +11 -1
  157. data/spec/income_tax/countries/guatemala_spec.rb +11 -1
  158. data/spec/income_tax/countries/guernsey_spec.rb +11 -1
  159. data/spec/income_tax/countries/guinea_bissau_spec.rb +11 -1
  160. data/spec/income_tax/countries/guinea_spec.rb +11 -1
  161. data/spec/income_tax/countries/guyana_spec.rb +11 -1
  162. data/spec/income_tax/countries/haiti_spec.rb +11 -1
  163. data/spec/income_tax/countries/heard_and_mcdonald_islands_spec.rb +11 -1
  164. data/spec/income_tax/countries/honduras_spec.rb +11 -1
  165. data/spec/income_tax/countries/hong_kong_spec.rb +11 -1
  166. data/spec/income_tax/countries/hungary_spec.rb +11 -1
  167. data/spec/income_tax/countries/iceland_spec.rb +11 -1
  168. data/spec/income_tax/countries/india_spec.rb +11 -1
  169. data/spec/income_tax/countries/indonesia_spec.rb +11 -1
  170. data/spec/income_tax/countries/iran_spec.rb +11 -1
  171. data/spec/income_tax/countries/iraq_spec.rb +11 -1
  172. data/spec/income_tax/countries/ireland_spec.rb +11 -1
  173. data/spec/income_tax/countries/isle_of_man_spec.rb +11 -1
  174. data/spec/income_tax/countries/israel_spec.rb +11 -1
  175. data/spec/income_tax/countries/italy_spec.rb +11 -1
  176. data/spec/income_tax/countries/ivory_coast_spec.rb +11 -1
  177. data/spec/income_tax/countries/jamaica_spec.rb +11 -1
  178. data/spec/income_tax/countries/japan_spec.rb +11 -1
  179. data/spec/income_tax/countries/jersey_spec.rb +11 -1
  180. data/spec/income_tax/countries/jordan_spec.rb +11 -1
  181. data/spec/income_tax/countries/kazakhstan_spec.rb +11 -1
  182. data/spec/income_tax/countries/kenya_spec.rb +11 -1
  183. data/spec/income_tax/countries/kiribati_spec.rb +11 -1
  184. data/spec/income_tax/countries/kosovo_spec.rb +11 -1
  185. data/spec/income_tax/countries/kuwait_spec.rb +11 -1
  186. data/spec/income_tax/countries/kyrgyzstan_spec.rb +11 -1
  187. data/spec/income_tax/countries/laos_spec.rb +11 -1
  188. data/spec/income_tax/countries/latvia_spec.rb +11 -1
  189. data/spec/income_tax/countries/lebanon_spec.rb +11 -1
  190. data/spec/income_tax/countries/lesotho_spec.rb +11 -1
  191. data/spec/income_tax/countries/liberia_spec.rb +11 -1
  192. data/spec/income_tax/countries/libya_spec.rb +11 -1
  193. data/spec/income_tax/countries/liechtenstein_spec.rb +11 -1
  194. data/spec/income_tax/countries/lithuania_spec.rb +11 -1
  195. data/spec/income_tax/countries/luxembourg_spec.rb +11 -1
  196. data/spec/income_tax/countries/macao_spec.rb +11 -1
  197. data/spec/income_tax/countries/macedonia_spec.rb +11 -1
  198. data/spec/income_tax/countries/madagascar_spec.rb +11 -1
  199. data/spec/income_tax/countries/malawi_spec.rb +11 -1
  200. data/spec/income_tax/countries/malaysia_spec.rb +11 -1
  201. data/spec/income_tax/countries/maldives_spec.rb +11 -1
  202. data/spec/income_tax/countries/mali_spec.rb +11 -1
  203. data/spec/income_tax/countries/malta_spec.rb +11 -1
  204. data/spec/income_tax/countries/marshall_islands_spec.rb +11 -1
  205. data/spec/income_tax/countries/martinique_spec.rb +11 -1
  206. data/spec/income_tax/countries/mauritania_spec.rb +11 -1
  207. data/spec/income_tax/countries/mauritius_spec.rb +11 -1
  208. data/spec/income_tax/countries/mayotte_spec.rb +11 -1
  209. data/spec/income_tax/countries/mexico_spec.rb +11 -1
  210. data/spec/income_tax/countries/micronesia_spec.rb +11 -1
  211. data/spec/income_tax/countries/moldova_spec.rb +11 -1
  212. data/spec/income_tax/countries/monaco_spec.rb +11 -1
  213. data/spec/income_tax/countries/mongolia_spec.rb +11 -1
  214. data/spec/income_tax/countries/montenegro_spec.rb +11 -1
  215. data/spec/income_tax/countries/montserrat_spec.rb +11 -1
  216. data/spec/income_tax/countries/morocco_spec.rb +11 -1
  217. data/spec/income_tax/countries/mozambique_spec.rb +11 -1
  218. data/spec/income_tax/countries/myanmar_spec.rb +11 -1
  219. data/spec/income_tax/countries/namibia_spec.rb +11 -1
  220. data/spec/income_tax/countries/nauru_spec.rb +11 -1
  221. data/spec/income_tax/countries/nepal_spec.rb +11 -1
  222. data/spec/income_tax/countries/netherlands_antilles_spec.rb +11 -1
  223. data/spec/income_tax/countries/netherlands_spec.rb +11 -1
  224. data/spec/income_tax/countries/new_caledonia_spec.rb +11 -1
  225. data/spec/income_tax/countries/new_zealand_spec.rb +11 -1
  226. data/spec/income_tax/countries/nicaragua_spec.rb +11 -1
  227. data/spec/income_tax/countries/niger_spec.rb +11 -1
  228. data/spec/income_tax/countries/nigeria_spec.rb +11 -1
  229. data/spec/income_tax/countries/niue_spec.rb +11 -1
  230. data/spec/income_tax/countries/norfolk_island_spec.rb +11 -1
  231. data/spec/income_tax/countries/north_korea_spec.rb +11 -1
  232. data/spec/income_tax/countries/northern_mariana_islands_spec.rb +11 -1
  233. data/spec/income_tax/countries/norway_spec.rb +88 -75
  234. data/spec/income_tax/countries/oman_spec.rb +11 -1
  235. data/spec/income_tax/countries/pakistan_spec.rb +11 -1
  236. data/spec/income_tax/countries/palau_spec.rb +11 -1
  237. data/spec/income_tax/countries/palestinian_territory_spec.rb +11 -1
  238. data/spec/income_tax/countries/panama_spec.rb +11 -1
  239. data/spec/income_tax/countries/papua_new_guinea_spec.rb +11 -1
  240. data/spec/income_tax/countries/paraguay_spec.rb +11 -1
  241. data/spec/income_tax/countries/peru_spec.rb +11 -1
  242. data/spec/income_tax/countries/philippines_spec.rb +11 -1
  243. data/spec/income_tax/countries/pitcairn_spec.rb +11 -1
  244. data/spec/income_tax/countries/poland_spec.rb +11 -1
  245. data/spec/income_tax/countries/portugal_spec.rb +11 -1
  246. data/spec/income_tax/countries/puerto_rico_spec.rb +11 -1
  247. data/spec/income_tax/countries/qatar_spec.rb +11 -1
  248. data/spec/income_tax/countries/reunion_spec.rb +11 -1
  249. data/spec/income_tax/countries/romania_spec.rb +11 -1
  250. data/spec/income_tax/countries/russia_spec.rb +11 -1
  251. data/spec/income_tax/countries/rwanda_spec.rb +11 -1
  252. data/spec/income_tax/countries/saint_barthelemy_spec.rb +11 -1
  253. data/spec/income_tax/countries/saint_helena_spec.rb +11 -1
  254. data/spec/income_tax/countries/saint_kitts_and_nevis_spec.rb +11 -1
  255. data/spec/income_tax/countries/saint_lucia_spec.rb +11 -1
  256. data/spec/income_tax/countries/saint_martin_spec.rb +11 -1
  257. data/spec/income_tax/countries/saint_pierre_and_miquelon_spec.rb +11 -1
  258. data/spec/income_tax/countries/saint_vincent_and_the_grenedines_spec.rb +11 -1
  259. data/spec/income_tax/countries/samoa_spec.rb +11 -1
  260. data/spec/income_tax/countries/san_marino_spec.rb +11 -1
  261. data/spec/income_tax/countries/sao_tome_and_principe_spec.rb +11 -1
  262. data/spec/income_tax/countries/saudi_arabia_spec.rb +11 -1
  263. data/spec/income_tax/countries/senegal_spec.rb +11 -1
  264. data/spec/income_tax/countries/serbia_spec.rb +11 -1
  265. data/spec/income_tax/countries/seychelles_spec.rb +11 -1
  266. data/spec/income_tax/countries/sierra_leone_spec.rb +11 -1
  267. data/spec/income_tax/countries/singapore_spec.rb +185 -74
  268. data/spec/income_tax/countries/sint_maarten_spec.rb +11 -1
  269. data/spec/income_tax/countries/slovakia_spec.rb +11 -1
  270. data/spec/income_tax/countries/slovenia_spec.rb +11 -1
  271. data/spec/income_tax/countries/solomon_islands_spec.rb +11 -1
  272. data/spec/income_tax/countries/somalia_spec.rb +11 -1
  273. data/spec/income_tax/countries/south_africa_spec.rb +11 -1
  274. data/spec/income_tax/countries/south_georgia_and_the_south_sandwich_islands_spec.rb +35 -25
  275. data/spec/income_tax/countries/south_korea_spec.rb +11 -1
  276. data/spec/income_tax/countries/south_sudan_spec.rb +11 -1
  277. data/spec/income_tax/countries/spain_spec.rb +11 -1
  278. data/spec/income_tax/countries/sri_lanka_spec.rb +11 -1
  279. data/spec/income_tax/countries/sudan_spec.rb +11 -1
  280. data/spec/income_tax/countries/suriname_spec.rb +11 -1
  281. data/spec/income_tax/countries/svalbard_and_jan_mayen_spec.rb +11 -1
  282. data/spec/income_tax/countries/swaziland_spec.rb +11 -1
  283. data/spec/income_tax/countries/sweden_spec.rb +11 -1
  284. data/spec/income_tax/countries/switzerland/aargau_spec.rb +11 -1
  285. data/spec/income_tax/countries/switzerland/appenzell_inner_spec.rb +11 -1
  286. data/spec/income_tax/countries/switzerland/appenzell_outer_spec.rb +11 -1
  287. data/spec/income_tax/countries/switzerland/basel_city_spec.rb +11 -1
  288. data/spec/income_tax/countries/switzerland/basel_land_spec.rb +11 -1
  289. data/spec/income_tax/countries/switzerland/bern_spec.rb +11 -1
  290. data/spec/income_tax/countries/switzerland/fribourg_spec.rb +11 -1
  291. data/spec/income_tax/countries/switzerland/geneva_spec.rb +11 -1
  292. data/spec/income_tax/countries/switzerland/glarus_spec.rb +11 -1
  293. data/spec/income_tax/countries/switzerland/grisons_spec.rb +11 -1
  294. data/spec/income_tax/countries/switzerland/jura_spec.rb +11 -1
  295. data/spec/income_tax/countries/switzerland/lucerne_spec.rb +11 -1
  296. data/spec/income_tax/countries/switzerland/neuchatel_spec.rb +11 -1
  297. data/spec/income_tax/countries/switzerland/nidwalden_spec.rb +11 -1
  298. data/spec/income_tax/countries/switzerland/obwalden_spec.rb +11 -1
  299. data/spec/income_tax/countries/switzerland/schaffhausen_spec.rb +11 -1
  300. data/spec/income_tax/countries/switzerland/schwyz_spec.rb +11 -1
  301. data/spec/income_tax/countries/switzerland/solothurn_spec.rb +11 -1
  302. data/spec/income_tax/countries/switzerland/st_gallen_spec.rb +11 -1
  303. data/spec/income_tax/countries/switzerland/thurgau_spec.rb +11 -1
  304. data/spec/income_tax/countries/switzerland/ticino_spec.rb +11 -1
  305. data/spec/income_tax/countries/switzerland/uri_spec.rb +11 -1
  306. data/spec/income_tax/countries/switzerland/valais_spec.rb +11 -1
  307. data/spec/income_tax/countries/switzerland/vaud_spec.rb +11 -1
  308. data/spec/income_tax/countries/switzerland/zug_spec.rb +11 -1
  309. data/spec/income_tax/countries/switzerland/zurich_spec.rb +185 -74
  310. data/spec/income_tax/countries/switzerland_spec.rb +11 -1
  311. data/spec/income_tax/countries/syria_spec.rb +11 -1
  312. data/spec/income_tax/countries/taiwan_spec.rb +11 -1
  313. data/spec/income_tax/countries/tajikistan_spec.rb +11 -1
  314. data/spec/income_tax/countries/tanzania_spec.rb +11 -1
  315. data/spec/income_tax/countries/thailand_spec.rb +11 -1
  316. data/spec/income_tax/countries/timor_leste_spec.rb +11 -1
  317. data/spec/income_tax/countries/togo_spec.rb +11 -1
  318. data/spec/income_tax/countries/tokelau_spec.rb +11 -1
  319. data/spec/income_tax/countries/tonga_spec.rb +11 -1
  320. data/spec/income_tax/countries/trinidad_and_tobago_spec.rb +11 -1
  321. data/spec/income_tax/countries/tunisia_spec.rb +11 -1
  322. data/spec/income_tax/countries/turkey_spec.rb +11 -1
  323. data/spec/income_tax/countries/turkmenistan_spec.rb +11 -1
  324. data/spec/income_tax/countries/turks_and_caicos_islands_spec.rb +11 -1
  325. data/spec/income_tax/countries/tuvalu_spec.rb +11 -1
  326. data/spec/income_tax/countries/uganda_spec.rb +11 -1
  327. data/spec/income_tax/countries/ukraine_spec.rb +11 -1
  328. data/spec/income_tax/countries/united_arab_emirates_spec.rb +11 -1
  329. data/spec/income_tax/countries/united_kingdom_spec.rb +185 -74
  330. data/spec/income_tax/countries/united_states/alabama_spec.rb +11 -1
  331. data/spec/income_tax/countries/united_states/alaska_spec.rb +11 -1
  332. data/spec/income_tax/countries/united_states/arizona_spec.rb +11 -1
  333. data/spec/income_tax/countries/united_states/arkansas_spec.rb +11 -1
  334. data/spec/income_tax/countries/united_states/california_spec.rb +11 -1
  335. data/spec/income_tax/countries/united_states/colorado_spec.rb +11 -1
  336. data/spec/income_tax/countries/united_states/connecticut_spec.rb +11 -1
  337. data/spec/income_tax/countries/united_states/dc_spec.rb +11 -1
  338. data/spec/income_tax/countries/united_states/delaware_spec.rb +11 -1
  339. data/spec/income_tax/countries/united_states/florida_spec.rb +11 -1
  340. data/spec/income_tax/countries/united_states/georgia_spec.rb +11 -1
  341. data/spec/income_tax/countries/united_states/hawaii_spec.rb +11 -1
  342. data/spec/income_tax/countries/united_states/idaho_spec.rb +11 -1
  343. data/spec/income_tax/countries/united_states/illinois_spec.rb +11 -1
  344. data/spec/income_tax/countries/united_states/indiana_spec.rb +11 -1
  345. data/spec/income_tax/countries/united_states/iowa_spec.rb +11 -1
  346. data/spec/income_tax/countries/united_states/kansas_spec.rb +11 -1
  347. data/spec/income_tax/countries/united_states/kentucky_spec.rb +11 -1
  348. data/spec/income_tax/countries/united_states/louisiana_spec.rb +11 -1
  349. data/spec/income_tax/countries/united_states/maine_spec.rb +11 -1
  350. data/spec/income_tax/countries/united_states/maryland_spec.rb +11 -1
  351. data/spec/income_tax/countries/united_states/massachusetts_spec.rb +11 -1
  352. data/spec/income_tax/countries/united_states/michigan_spec.rb +11 -1
  353. data/spec/income_tax/countries/united_states/minnesota_spec.rb +11 -1
  354. data/spec/income_tax/countries/united_states/mississippi_spec.rb +11 -1
  355. data/spec/income_tax/countries/united_states/missouri_spec.rb +11 -1
  356. data/spec/income_tax/countries/united_states/montana_spec.rb +11 -1
  357. data/spec/income_tax/countries/united_states/nebraska_spec.rb +11 -1
  358. data/spec/income_tax/countries/united_states/nevada_spec.rb +11 -1
  359. data/spec/income_tax/countries/united_states/new_hampshire_spec.rb +11 -1
  360. data/spec/income_tax/countries/united_states/new_jersey_spec.rb +11 -1
  361. data/spec/income_tax/countries/united_states/new_mexico_spec.rb +11 -1
  362. data/spec/income_tax/countries/united_states/new_york_spec.rb +11 -1
  363. data/spec/income_tax/countries/united_states/north_carolina_spec.rb +11 -1
  364. data/spec/income_tax/countries/united_states/north_dakota_spec.rb +11 -1
  365. data/spec/income_tax/countries/united_states/ohio_spec.rb +11 -1
  366. data/spec/income_tax/countries/united_states/oklahoma_spec.rb +11 -1
  367. data/spec/income_tax/countries/united_states/oregon_spec.rb +11 -1
  368. data/spec/income_tax/countries/united_states/pennsylvania_spec.rb +11 -1
  369. data/spec/income_tax/countries/united_states/rhode_island_spec.rb +11 -1
  370. data/spec/income_tax/countries/united_states/south_carolina_spec.rb +11 -1
  371. data/spec/income_tax/countries/united_states/south_dakota_spec.rb +11 -1
  372. data/spec/income_tax/countries/united_states/tennessee_spec.rb +11 -1
  373. data/spec/income_tax/countries/united_states/texas_spec.rb +11 -1
  374. data/spec/income_tax/countries/united_states/utah_spec.rb +11 -1
  375. data/spec/income_tax/countries/united_states/vermont_spec.rb +11 -1
  376. data/spec/income_tax/countries/united_states/virginia_spec.rb +11 -1
  377. data/spec/income_tax/countries/united_states/washington_spec.rb +11 -1
  378. data/spec/income_tax/countries/united_states/west_virginia_spec.rb +11 -1
  379. data/spec/income_tax/countries/united_states/wisconsin_spec.rb +11 -1
  380. data/spec/income_tax/countries/united_states/wyoming_spec.rb +11 -1
  381. data/spec/income_tax/countries/united_states_minor_outlying_islands_spec.rb +11 -1
  382. data/spec/income_tax/countries/united_states_spec.rb +11 -1
  383. data/spec/income_tax/countries/uruguay_spec.rb +11 -1
  384. data/spec/income_tax/countries/uzbekistan_spec.rb +11 -1
  385. data/spec/income_tax/countries/vanuatu_spec.rb +11 -1
  386. data/spec/income_tax/countries/vatican_spec.rb +11 -1
  387. data/spec/income_tax/countries/venezuela_spec.rb +11 -1
  388. data/spec/income_tax/countries/vietnam_spec.rb +11 -1
  389. data/spec/income_tax/countries/virgin_islands_british_spec.rb +11 -1
  390. data/spec/income_tax/countries/virgin_islands_us_spec.rb +11 -1
  391. data/spec/income_tax/countries/wallis_and_futuna_spec.rb +11 -1
  392. data/spec/income_tax/countries/western_sahara_spec.rb +11 -1
  393. data/spec/income_tax/countries/yemen_spec.rb +11 -1
  394. data/spec/income_tax/countries/zambia_spec.rb +11 -1
  395. data/spec/income_tax/countries/zimbabwe_spec.rb +11 -1
  396. metadata +3 -2
@@ -1,89 +1,886 @@
1
1
  describe IncomeTax::Countries::Germany do
2
- subject(:result) { described_class.new(income: income, income_type: type) }
2
+ subject(:result) { described_class.new(income: income, income_type: type, tax_year: tax_year) }
3
3
  let(:type) { :gross }
4
4
 
5
- describe "from gross income of 0" do
6
- let(:income) { 0 }
7
- its(:rate) { should be == Rational(0, 1) }
8
- its(:gross_income) { should be == 0 }
9
- its(:net_income) { should be == 0 }
10
- its(:taxes) { should be == 0 }
11
- end
5
+ describe "tax year 2002" do
6
+
7
+ describe "from gross income of 0" do
8
+ let(:tax_year) { 2002 }
9
+ let(:income) { 0 }
10
+ its(:rate) { should be == Rational(0, 1) }
11
+ its(:gross_income) { should be == 0 }
12
+ its(:net_income) { should be == 0 }
13
+ its(:taxes) { should be == 0 }
14
+ end
15
+
16
+ describe "from gross income of 1000" do
17
+ let(:tax_year) { 2002 }
18
+ let(:income) { 1000 }
19
+ its(:rate) { should be == Rational(0, 1) }
20
+ its(:gross_income) { should be == 1000 }
21
+ its(:net_income) { should be == 1000 }
22
+ its(:taxes) { should be == 0 }
23
+ end
24
+
25
+ describe "from gross income of 10000" do
26
+ let(:tax_year) { 2002 }
27
+ let(:income) { 10000 }
28
+ its(:rate) { should be == Rational(3, 47) }
29
+ its(:gross_income) { should be == 10000 }
30
+ its(:net_income) { should be == "9361.725".to_d }
31
+ its(:taxes) { should be == "638.275".to_d }
32
+ end
33
+
34
+ describe "from gross income of 100000" do
35
+ let(:tax_year) { 2002 }
36
+ let(:income) { 100000 }
37
+ its(:rate) { should be == Rational(119, 292) }
38
+ its(:gross_income) { should be == 100000 }
39
+ its(:net_income) { should be == "59247.46".to_d }
40
+ its(:taxes) { should be == "40752.54".to_d }
41
+ end
42
+
43
+ describe "from gross income of 100000000" do
44
+ let(:tax_year) { 2002 }
45
+ let(:income) { 100000000 }
46
+ its(:rate) { should be == Rational(199, 389) }
47
+ its(:gross_income) { should be == 100000000 }
48
+ its(:net_income) { should be == "48842914.96".to_d }
49
+ its(:taxes) { should be == "51157085.04".to_d }
50
+ end
12
51
 
13
- describe "from gross income of 1000" do
14
- let(:income) { 1000 }
15
- its(:rate) { should be == Rational(11, 200) }
16
- its(:gross_income) { should be == 1000 }
17
- its(:net_income) { should be == 945 }
18
- its(:taxes) { should be == 55 }
52
+ describe "from net income of 0" do
53
+ let(:type) { :net }
54
+ let(:tax_year) { 2002 }
55
+ let(:income) { 0 }
56
+ its(:rate) { should be == Rational(0, 1) }
57
+ its(:gross_income) { should be == 0 }
58
+ its(:net_income) { should be == 0 }
59
+ its(:taxes) { should be == 0 }
60
+ end
61
+
62
+ describe "from net income of 1000" do
63
+ let(:type) { :net }
64
+ let(:tax_year) { 2002 }
65
+ let(:income) { 1000 }
66
+ its(:rate) { should be == Rational(11, 200) }
67
+ its(:gross_income) { should be == "1058.2010582010582".to_d }
68
+ its(:net_income) { should be == 1000 }
69
+ its(:taxes) { should be == "58.2010582010582".to_d }
70
+ end
71
+
72
+ describe "from net income of 10000" do
73
+ let(:type) { :net }
74
+ let(:tax_year) { 2002 }
75
+ let(:income) { 10000 }
76
+ its(:rate) { should be == Rational(56, 463) }
77
+ its(:gross_income) { should be == "11376.010582010582".to_d }
78
+ its(:net_income) { should be == 10000 }
79
+ its(:taxes) { should be == "1376.010582010582".to_d }
80
+ end
81
+
82
+ describe "from net income of 100000" do
83
+ let(:type) { :net }
84
+ let(:tax_year) { 2002 }
85
+ let(:income) { 100000 }
86
+ its(:rate) { should be == Rational(156, 349) }
87
+ its(:gross_income) { should be == "180826.10582010582".to_d }
88
+ its(:net_income) { should be == 100000 }
89
+ its(:taxes) { should be == "80826.10582010582".to_d }
90
+ end
91
+
92
+ describe "from net income of 100000000" do
93
+ let(:type) { :net }
94
+ let(:tax_year) { 2002 }
95
+ let(:income) { 100000000 }
96
+ its(:rate) { should be == Rational(3532, 7065) }
97
+ its(:gross_income) { should be == "199975693.82010582".to_d }
98
+ its(:net_income) { should be == 100000000 }
99
+ its(:taxes) { should be == "99975693.82010582".to_d }
100
+ end
19
101
  end
20
102
 
21
- describe "from gross income of 10000" do
22
- let(:income) { 10000 }
23
- its(:rate) { should be == Rational(17, 216) }
24
- its(:gross_income) { should be == 10000 }
25
- its(:net_income) { should be == 9213 }
26
- its(:taxes) { should be == 787 }
103
+ describe "tax year 2004" do
104
+
105
+ describe "from gross income of 0" do
106
+ let(:tax_year) { 2004 }
107
+ let(:income) { 0 }
108
+ its(:rate) { should be == Rational(0, 1) }
109
+ its(:gross_income) { should be == 0 }
110
+ its(:net_income) { should be == 0 }
111
+ its(:taxes) { should be == 0 }
112
+ end
113
+
114
+ describe "from gross income of 1000" do
115
+ let(:tax_year) { 2004 }
116
+ let(:income) { 1000 }
117
+ its(:rate) { should be == Rational(0, 1) }
118
+ its(:gross_income) { should be == 1000 }
119
+ its(:net_income) { should be == 1000 }
120
+ its(:taxes) { should be == 0 }
121
+ end
122
+
123
+ describe "from gross income of 10000" do
124
+ let(:tax_year) { 2004 }
125
+ let(:income) { 10000 }
126
+ its(:rate) { should be == Rational(11, 250) }
127
+ its(:gross_income) { should be == 10000 }
128
+ its(:net_income) { should be == "9560.065".to_d }
129
+ its(:taxes) { should be == "439.935".to_d }
130
+ end
131
+
132
+ describe "from gross income of 100000" do
133
+ let(:tax_year) { 2004 }
134
+ let(:income) { 100000 }
135
+ its(:rate) { should be == Rational(37, 97) }
136
+ its(:gross_income) { should be == 100000 }
137
+ its(:net_income) { should be == "61856.475".to_d }
138
+ its(:taxes) { should be == "38143.525".to_d }
139
+ end
140
+
141
+ describe "from gross income of 100000000" do
142
+ let(:tax_year) { 2004 }
143
+ let(:income) { 100000000 }
144
+ its(:rate) { should be == Rational(103, 217) }
145
+ its(:gross_income) { should be == 100000000 }
146
+ its(:net_income) { should be == "52534331.475".to_d }
147
+ its(:taxes) { should be == "47465668.525".to_d }
148
+ end
149
+
150
+ describe "from net income of 0" do
151
+ let(:type) { :net }
152
+ let(:tax_year) { 2004 }
153
+ let(:income) { 0 }
154
+ its(:rate) { should be == Rational(0, 1) }
155
+ its(:gross_income) { should be == 0 }
156
+ its(:net_income) { should be == 0 }
157
+ its(:taxes) { should be == 0 }
158
+ end
159
+
160
+ describe "from net income of 1000" do
161
+ let(:type) { :net }
162
+ let(:tax_year) { 2004 }
163
+ let(:income) { 1000 }
164
+ its(:rate) { should be == Rational(11, 200) }
165
+ its(:gross_income) { should be == "1058.2010582010582".to_d }
166
+ its(:net_income) { should be == 1000 }
167
+ its(:taxes) { should be == "58.2010582010582".to_d }
168
+ end
169
+
170
+ describe "from net income of 10000" do
171
+ let(:type) { :net }
172
+ let(:tax_year) { 2004 }
173
+ let(:income) { 10000 }
174
+ its(:rate) { should be == Rational(20, 201) }
175
+ its(:gross_income) { should be == "11105.010582010582".to_d }
176
+ its(:net_income) { should be == 10000 }
177
+ its(:taxes) { should be == "1105.010582010582".to_d }
178
+ end
179
+
180
+ describe "from net income of 100000" do
181
+ let(:type) { :net }
182
+ let(:tax_year) { 2004 }
183
+ let(:income) { 100000 }
184
+ its(:rate) { should be == Rational(161, 386) }
185
+ its(:gross_income) { should be == "171555.10582010582".to_d }
186
+ its(:net_income) { should be == 100000 }
187
+ its(:taxes) { should be == "71555.10582010582".to_d }
188
+ end
189
+
190
+ describe "from net income of 100000000" do
191
+ let(:type) { :net }
192
+ let(:tax_year) { 2004 }
193
+ let(:income) { 100000000 }
194
+ its(:rate) { should be == Rational(92, 197) }
195
+ its(:gross_income) { should be == "187622204.82010582".to_d }
196
+ its(:net_income) { should be == 100000000 }
197
+ its(:taxes) { should be == "87622204.82010582".to_d }
198
+ end
27
199
  end
28
200
 
29
- describe "from gross income of 100000" do
30
- let(:income) { 100000 }
31
- its(:rate) { should be == Rational(144, 367) }
32
- its(:gross_income) { should be == 100000 }
33
- its(:net_income) { should be == 60762 }
34
- its(:taxes) { should be == 39238 }
201
+ describe "tax year 2005" do
202
+
203
+ describe "from gross income of 0" do
204
+ let(:tax_year) { 2005 }
205
+ let(:income) { 0 }
206
+ its(:rate) { should be == Rational(0, 1) }
207
+ its(:gross_income) { should be == 0 }
208
+ its(:net_income) { should be == 0 }
209
+ its(:taxes) { should be == 0 }
210
+ end
211
+
212
+ describe "from gross income of 1000" do
213
+ let(:tax_year) { 2005 }
214
+ let(:income) { 1000 }
215
+ its(:rate) { should be == Rational(0, 1) }
216
+ its(:gross_income) { should be == 1000 }
217
+ its(:net_income) { should be == 1000 }
218
+ its(:taxes) { should be == 0 }
219
+ end
220
+
221
+ describe "from gross income of 10000" do
222
+ let(:tax_year) { 2005 }
223
+ let(:income) { 10000 }
224
+ its(:rate) { should be == Rational(11, 262) }
225
+ its(:gross_income) { should be == 10000 }
226
+ its(:net_income) { should be == "9580.11".to_d }
227
+ its(:taxes) { should be == "419.89".to_d }
228
+ end
229
+
230
+ describe "from gross income of 100000" do
231
+ let(:tax_year) { 2005 }
232
+ let(:income) { 100000 }
233
+ its(:rate) { should be == Rational(73, 203) }
234
+ its(:gross_income) { should be == 100000 }
235
+ its(:net_income) { should be == "64039.27".to_d }
236
+ its(:taxes) { should be == "35960.73".to_d }
237
+ end
238
+
239
+ describe "from gross income of 100000000" do
240
+ let(:tax_year) { 2005 }
241
+ let(:income) { 100000000 }
242
+ its(:rate) { should be == Rational(206, 465) }
243
+ its(:gross_income) { should be == 100000000 }
244
+ its(:net_income) { should be == "55698349.27".to_d }
245
+ its(:taxes) { should be == "44301650.73".to_d }
246
+ end
247
+
248
+ describe "from net income of 0" do
249
+ let(:type) { :net }
250
+ let(:tax_year) { 2005 }
251
+ let(:income) { 0 }
252
+ its(:rate) { should be == Rational(0, 1) }
253
+ its(:gross_income) { should be == 0 }
254
+ its(:net_income) { should be == 0 }
255
+ its(:taxes) { should be == 0 }
256
+ end
257
+
258
+ describe "from net income of 1000" do
259
+ let(:type) { :net }
260
+ let(:tax_year) { 2005 }
261
+ let(:income) { 1000 }
262
+ its(:rate) { should be == Rational(11, 200) }
263
+ its(:gross_income) { should be == "1058.2010582010582".to_d }
264
+ its(:net_income) { should be == 1000 }
265
+ its(:taxes) { should be == "58.2010582010582".to_d }
266
+ end
267
+
268
+ describe "from net income of 10000" do
269
+ let(:type) { :net }
270
+ let(:tax_year) { 2005 }
271
+ let(:income) { 10000 }
272
+ its(:rate) { should be == Rational(41, 421) }
273
+ its(:gross_income) { should be == "11079.010582010582".to_d }
274
+ its(:net_income) { should be == 10000 }
275
+ its(:taxes) { should be == "1079.010582010582".to_d }
276
+ end
277
+
278
+ describe "from net income of 100000" do
279
+ let(:type) { :net }
280
+ let(:tax_year) { 2005 }
281
+ let(:income) { 100000 }
282
+ its(:rate) { should be == Rational(166, 423) }
283
+ its(:gross_income) { should be == "164589.10582010582".to_d }
284
+ its(:net_income) { should be == 100000 }
285
+ its(:taxes) { should be == "64589.10582010582".to_d }
286
+ end
287
+
288
+ describe "from net income of 100000000" do
289
+ let(:type) { :net }
290
+ let(:tax_year) { 2005 }
291
+ let(:income) { 100000000 }
292
+ its(:rate) { should be == Rational(79, 180) }
293
+ its(:gross_income) { should be == "178220253.82010582".to_d }
294
+ its(:net_income) { should be == 100000000 }
295
+ its(:taxes) { should be == "78220253.82010582".to_d }
296
+ end
35
297
  end
36
298
 
37
- describe "from gross income of 100000000" do
38
- let(:income) { 100000000 }
39
- its(:rate) { should be == Rational(261, 517) }
40
- its(:gross_income) { should be == 100000000 }
41
- its(:net_income) { should be == 49515784 }
42
- its(:taxes) { should be == 50484216 }
299
+ describe "tax year 2007" do
300
+
301
+ describe "from gross income of 0" do
302
+ let(:tax_year) { 2007 }
303
+ let(:income) { 0 }
304
+ its(:rate) { should be == Rational(0, 1) }
305
+ its(:gross_income) { should be == 0 }
306
+ its(:net_income) { should be == 0 }
307
+ its(:taxes) { should be == 0 }
308
+ end
309
+
310
+ describe "from gross income of 1000" do
311
+ let(:tax_year) { 2007 }
312
+ let(:income) { 1000 }
313
+ its(:rate) { should be == Rational(0, 1) }
314
+ its(:gross_income) { should be == 1000 }
315
+ its(:net_income) { should be == 1000 }
316
+ its(:taxes) { should be == 0 }
317
+ end
318
+
319
+ describe "from gross income of 10000" do
320
+ let(:tax_year) { 2007 }
321
+ let(:income) { 10000 }
322
+ its(:rate) { should be == Rational(11, 262) }
323
+ its(:gross_income) { should be == 10000 }
324
+ its(:net_income) { should be == "9580.11".to_d }
325
+ its(:taxes) { should be == "419.89".to_d }
326
+ end
327
+
328
+ describe "from gross income of 100000" do
329
+ let(:tax_year) { 2007 }
330
+ let(:income) { 100000 }
331
+ its(:rate) { should be == Rational(73, 203) }
332
+ its(:gross_income) { should be == 100000 }
333
+ its(:net_income) { should be == "64039.27".to_d }
334
+ its(:taxes) { should be == "35960.73".to_d }
335
+ end
336
+
337
+ describe "from gross income of 100000000" do
338
+ let(:tax_year) { 2007 }
339
+ let(:income) { 100000000 }
340
+ its(:rate) { should be == Rational(383, 807) }
341
+ its(:gross_income) { should be == 100000000 }
342
+ its(:net_income) { should be == "52541261.77".to_d }
343
+ its(:taxes) { should be == "47458738.23".to_d }
344
+ end
345
+
346
+ describe "from net income of 0" do
347
+ let(:type) { :net }
348
+ let(:tax_year) { 2007 }
349
+ let(:income) { 0 }
350
+ its(:rate) { should be == Rational(0, 1) }
351
+ its(:gross_income) { should be == 0 }
352
+ its(:net_income) { should be == 0 }
353
+ its(:taxes) { should be == 0 }
354
+ end
355
+
356
+ describe "from net income of 1000" do
357
+ let(:type) { :net }
358
+ let(:tax_year) { 2007 }
359
+ let(:income) { 1000 }
360
+ its(:rate) { should be == Rational(11, 200) }
361
+ its(:gross_income) { should be == "1058.2010582010582".to_d }
362
+ its(:net_income) { should be == 1000 }
363
+ its(:taxes) { should be == "58.2010582010582".to_d }
364
+ end
365
+
366
+ describe "from net income of 10000" do
367
+ let(:type) { :net }
368
+ let(:tax_year) { 2007 }
369
+ let(:income) { 10000 }
370
+ its(:rate) { should be == Rational(41, 421) }
371
+ its(:gross_income) { should be == "11079.010582010582".to_d }
372
+ its(:net_income) { should be == 10000 }
373
+ its(:taxes) { should be == "1079.010582010582".to_d }
374
+ end
375
+
376
+ describe "from net income of 100000" do
377
+ let(:type) { :net }
378
+ let(:tax_year) { 2007 }
379
+ let(:income) { 100000 }
380
+ its(:rate) { should be == Rational(166, 423) }
381
+ its(:gross_income) { should be == "164589.10582010582".to_d }
382
+ its(:net_income) { should be == 100000 }
383
+ its(:taxes) { should be == "64589.10582010582".to_d }
384
+ end
385
+
386
+ describe "from net income of 100000000" do
387
+ let(:type) { :net }
388
+ let(:tax_year) { 2007 }
389
+ let(:income) { 100000000 }
390
+ its(:rate) { should be == Rational(99, 212) }
391
+ its(:gross_income) { should be == "187610260.82010582".to_d }
392
+ its(:net_income) { should be == 100000000 }
393
+ its(:taxes) { should be == "87610260.82010582".to_d }
394
+ end
43
395
  end
44
396
 
45
- describe "from net income of 0" do
46
- let(:type) { :net }
47
- let(:income) { 0 }
48
- its(:rate) { should be == Rational(0, 1) }
49
- its(:gross_income) { should be == 0 }
50
- its(:net_income) { should be == 0 }
51
- its(:taxes) { should be == 0 }
397
+ describe "tax year 2009" do
398
+
399
+ describe "from gross income of 0" do
400
+ let(:tax_year) { 2009 }
401
+ let(:income) { 0 }
402
+ its(:rate) { should be == Rational(0, 1) }
403
+ its(:gross_income) { should be == 0 }
404
+ its(:net_income) { should be == 0 }
405
+ its(:taxes) { should be == 0 }
406
+ end
407
+
408
+ describe "from gross income of 1000" do
409
+ let(:tax_year) { 2009 }
410
+ let(:income) { 1000 }
411
+ its(:rate) { should be == Rational(0, 1) }
412
+ its(:gross_income) { should be == 1000 }
413
+ its(:net_income) { should be == 1000 }
414
+ its(:taxes) { should be == 0 }
415
+ end
416
+
417
+ describe "from gross income of 10000" do
418
+ let(:tax_year) { 2009 }
419
+ let(:income) { 10000 }
420
+ its(:rate) { should be == Rational(16, 437) }
421
+ its(:gross_income) { should be == 10000 }
422
+ its(:net_income) { should be == "9633.915".to_d }
423
+ its(:taxes) { should be == "366.085".to_d }
424
+ end
425
+
426
+ describe "from gross income of 100000" do
427
+ let(:tax_year) { 2009 }
428
+ let(:income) { 100000 }
429
+ its(:rate) { should be == Rational(237, 662) }
430
+ its(:gross_income) { should be == 100000 }
431
+ its(:net_income) { should be == "64198.575".to_d }
432
+ its(:taxes) { should be == "35801.425".to_d }
433
+ end
434
+
435
+ describe "from gross income of 100000000" do
436
+ let(:tax_year) { 2009 }
437
+ let(:income) { 100000000 }
438
+ its(:rate) { should be == Rational(28, 59) }
439
+ its(:gross_income) { should be == 100000000 }
440
+ its(:net_income) { should be == "52541432.68".to_d }
441
+ its(:taxes) { should be == "47458567.32".to_d }
442
+ end
443
+
444
+ describe "from net income of 0" do
445
+ let(:type) { :net }
446
+ let(:tax_year) { 2009 }
447
+ let(:income) { 0 }
448
+ its(:rate) { should be == Rational(0, 1) }
449
+ its(:gross_income) { should be == 0 }
450
+ its(:net_income) { should be == 0 }
451
+ its(:taxes) { should be == 0 }
452
+ end
453
+
454
+ describe "from net income of 1000" do
455
+ let(:type) { :net }
456
+ let(:tax_year) { 2009 }
457
+ let(:income) { 1000 }
458
+ its(:rate) { should be == Rational(11, 200) }
459
+ its(:gross_income) { should be == "1058.2010582010582".to_d }
460
+ its(:net_income) { should be == 1000 }
461
+ its(:taxes) { should be == "58.2010582010582".to_d }
462
+ end
463
+
464
+ describe "from net income of 10000" do
465
+ let(:type) { :net }
466
+ let(:tax_year) { 2009 }
467
+ let(:income) { 10000 }
468
+ its(:rate) { should be == Rational(10, 109) }
469
+ its(:gross_income) { should be == "11010.010582010582".to_d }
470
+ its(:net_income) { should be == 10000 }
471
+ its(:taxes) { should be == "1010.010582010582".to_d }
472
+ end
473
+
474
+ describe "from net income of 100000" do
475
+ let(:type) { :net }
476
+ let(:tax_year) { 2009 }
477
+ let(:income) { 100000 }
478
+ its(:rate) { should be == Rational(110, 281) }
479
+ its(:gross_income) { should be == "164328.10582010582".to_d }
480
+ its(:net_income) { should be == 100000 }
481
+ its(:taxes) { should be == "64328.10582010582".to_d }
482
+ end
483
+
484
+ describe "from net income of 100000000" do
485
+ let(:type) { :net }
486
+ let(:tax_year) { 2009 }
487
+ let(:income) { 100000000 }
488
+ its(:rate) { should be == Rational(99, 212) }
489
+ its(:gross_income) { should be == "187609966.82010582".to_d }
490
+ its(:net_income) { should be == 100000000 }
491
+ its(:taxes) { should be == "87609966.82010582".to_d }
492
+ end
52
493
  end
53
494
 
54
- describe "from net income of 1000" do
55
- let(:type) { :net }
56
- let(:income) { 1000 }
57
- its(:rate) { should be == Rational(11, 200) }
58
- its(:gross_income) { should be == "1058.2010582010582".to_d }
59
- its(:net_income) { should be == 1000 }
60
- its(:taxes) { should be == "58.2010582010582".to_d }
495
+ describe "tax year 2010" do
496
+
497
+ describe "from gross income of 0" do
498
+ let(:tax_year) { 2010 }
499
+ let(:income) { 0 }
500
+ its(:rate) { should be == Rational(0, 1) }
501
+ its(:gross_income) { should be == 0 }
502
+ its(:net_income) { should be == 0 }
503
+ its(:taxes) { should be == 0 }
504
+ end
505
+
506
+ describe "from gross income of 1000" do
507
+ let(:tax_year) { 2010 }
508
+ let(:income) { 1000 }
509
+ its(:rate) { should be == Rational(0, 1) }
510
+ its(:gross_income) { should be == 1000 }
511
+ its(:net_income) { should be == 1000 }
512
+ its(:taxes) { should be == 0 }
513
+ end
514
+
515
+ describe "from gross income of 10000" do
516
+ let(:tax_year) { 2010 }
517
+ let(:income) { 10000 }
518
+ its(:rate) { should be == Rational(10, 301) }
519
+ its(:gross_income) { should be == 10000 }
520
+ its(:net_income) { should be == "9667.675".to_d }
521
+ its(:taxes) { should be == "332.325".to_d }
522
+ end
523
+
524
+ describe "from gross income of 100000" do
525
+ let(:tax_year) { 2010 }
526
+ let(:income) { 100000 }
527
+ its(:rate) { should be == Rational(96, 269) }
528
+ its(:gross_income) { should be == 100000 }
529
+ its(:net_income) { should be == "64312.515".to_d }
530
+ its(:taxes) { should be == "35687.485".to_d }
531
+ end
532
+
533
+ describe "from gross income of 100000000" do
534
+ let(:tax_year) { 2010 }
535
+ let(:income) { 100000000 }
536
+ its(:rate) { should be == Rational(28, 59) }
537
+ its(:gross_income) { should be == 100000000 }
538
+ its(:net_income) { should be == "52541558.225".to_d }
539
+ its(:taxes) { should be == "47458441.775".to_d }
540
+ end
541
+
542
+ describe "from net income of 0" do
543
+ let(:type) { :net }
544
+ let(:tax_year) { 2010 }
545
+ let(:income) { 0 }
546
+ its(:rate) { should be == Rational(0, 1) }
547
+ its(:gross_income) { should be == 0 }
548
+ its(:net_income) { should be == 0 }
549
+ its(:taxes) { should be == 0 }
550
+ end
551
+
552
+ describe "from net income of 1000" do
553
+ let(:type) { :net }
554
+ let(:tax_year) { 2010 }
555
+ let(:income) { 1000 }
556
+ its(:rate) { should be == Rational(11, 200) }
557
+ its(:gross_income) { should be == "1058.2010582010582".to_d }
558
+ its(:net_income) { should be == 1000 }
559
+ its(:taxes) { should be == "58.2010582010582".to_d }
560
+ end
561
+
562
+ describe "from net income of 10000" do
563
+ let(:type) { :net }
564
+ let(:tax_year) { 2010 }
565
+ let(:income) { 10000 }
566
+ its(:rate) { should be == Rational(25, 283) }
567
+ its(:gross_income) { should be == "10969.010582010582".to_d }
568
+ its(:net_income) { should be == 10000 }
569
+ its(:taxes) { should be == "969.010582010582".to_d }
570
+ end
571
+
572
+ describe "from net income of 100000" do
573
+ let(:type) { :net }
574
+ let(:tax_year) { 2010 }
575
+ let(:income) { 100000 }
576
+ its(:rate) { should be == Rational(127, 325) }
577
+ its(:gross_income) { should be == "164143.10582010582".to_d }
578
+ its(:net_income) { should be == 100000 }
579
+ its(:taxes) { should be == "64143.10582010582".to_d }
580
+ end
581
+
582
+ describe "from net income of 100000000" do
583
+ let(:type) { :net }
584
+ let(:tax_year) { 2010 }
585
+ let(:income) { 100000000 }
586
+ its(:rate) { should be == Rational(99, 212) }
587
+ its(:gross_income) { should be == "187609750.82010582".to_d }
588
+ its(:net_income) { should be == 100000000 }
589
+ its(:taxes) { should be == "87609750.82010582".to_d }
590
+ end
61
591
  end
62
592
 
63
- describe "from net income of 10000" do
64
- let(:type) { :net }
65
- let(:income) { 10000 }
66
- its(:rate) { should be == Rational(69, 862) }
67
- its(:gross_income) { should be == "10870.010582010582".to_d }
68
- its(:net_income) { should be == 10000 }
69
- its(:taxes) { should be == "870.010582010582".to_d }
593
+ describe "tax year 2013" do
594
+
595
+ describe "from gross income of 0" do
596
+ let(:tax_year) { 2013 }
597
+ let(:income) { 0 }
598
+ its(:rate) { should be == Rational(0, 1) }
599
+ its(:gross_income) { should be == 0 }
600
+ its(:net_income) { should be == 0 }
601
+ its(:taxes) { should be == 0 }
602
+ end
603
+
604
+ describe "from gross income of 1000" do
605
+ let(:tax_year) { 2013 }
606
+ let(:income) { 1000 }
607
+ its(:rate) { should be == Rational(0, 1) }
608
+ its(:gross_income) { should be == 1000 }
609
+ its(:net_income) { should be == 1000 }
610
+ its(:taxes) { should be == 0 }
611
+ end
612
+
613
+ describe "from gross income of 10000" do
614
+ let(:tax_year) { 2013 }
615
+ let(:income) { 10000 }
616
+ its(:rate) { should be == Rational(4, 129) }
617
+ its(:gross_income) { should be == 10000 }
618
+ its(:net_income) { should be == "9689.83".to_d }
619
+ its(:taxes) { should be == "310.17".to_d }
620
+ end
621
+
622
+ describe "from gross income of 100000" do
623
+ let(:tax_year) { 2013 }
624
+ let(:income) { 100000 }
625
+ its(:rate) { should be == Rational(97, 272) }
626
+ its(:gross_income) { should be == 100000 }
627
+ its(:net_income) { should be == "64337.835".to_d }
628
+ its(:taxes) { should be == "35662.165".to_d }
629
+ end
630
+
631
+ describe "from gross income of 100000000" do
632
+ let(:tax_year) { 2013 }
633
+ let(:income) { 100000000 }
634
+ its(:rate) { should be == Rational(28, 59) }
635
+ its(:gross_income) { should be == 100000000 }
636
+ its(:net_income) { should be == "52541583.545".to_d }
637
+ its(:taxes) { should be == "47458416.455".to_d }
638
+ end
639
+
640
+ describe "from net income of 0" do
641
+ let(:type) { :net }
642
+ let(:tax_year) { 2013 }
643
+ let(:income) { 0 }
644
+ its(:rate) { should be == Rational(0, 1) }
645
+ its(:gross_income) { should be == 0 }
646
+ its(:net_income) { should be == 0 }
647
+ its(:taxes) { should be == 0 }
648
+ end
649
+
650
+ describe "from net income of 1000" do
651
+ let(:type) { :net }
652
+ let(:tax_year) { 2013 }
653
+ let(:income) { 1000 }
654
+ its(:rate) { should be == Rational(11, 200) }
655
+ its(:gross_income) { should be == "1058.2010582010582".to_d }
656
+ its(:net_income) { should be == 1000 }
657
+ its(:taxes) { should be == "58.2010582010582".to_d }
658
+ end
659
+
660
+ describe "from net income of 10000" do
661
+ let(:type) { :net }
662
+ let(:tax_year) { 2013 }
663
+ let(:income) { 10000 }
664
+ its(:rate) { should be == Rational(13, 151) }
665
+ its(:gross_income) { should be == "10942.010582010582".to_d }
666
+ its(:net_income) { should be == 10000 }
667
+ its(:taxes) { should be == "942.010582010582".to_d }
668
+ end
669
+
670
+ describe "from net income of 100000" do
671
+ let(:type) { :net }
672
+ let(:tax_year) { 2013 }
673
+ let(:income) { 100000 }
674
+ its(:rate) { should be == Rational(25, 64) }
675
+ its(:gross_income) { should be == "164102.10582010582".to_d }
676
+ its(:net_income) { should be == 100000 }
677
+ its(:taxes) { should be == "64102.10582010582".to_d }
678
+ end
679
+
680
+ describe "from net income of 100000000" do
681
+ let(:type) { :net }
682
+ let(:tax_year) { 2013 }
683
+ let(:income) { 100000000 }
684
+ its(:rate) { should be == Rational(99, 212) }
685
+ its(:gross_income) { should be == "187609706.82010582".to_d }
686
+ its(:net_income) { should be == 100000000 }
687
+ its(:taxes) { should be == "87609706.82010582".to_d }
688
+ end
70
689
  end
71
690
 
72
- describe "from net income of 100000" do
73
- let(:type) { :net }
74
- let(:income) { 100000 }
75
- its(:rate) { should be == Rational(199, 510) }
76
- its(:gross_income) { should be == "163989.10582010582".to_d }
77
- its(:net_income) { should be == 100000 }
78
- its(:taxes) { should be == "63989.10582010582".to_d }
691
+ describe "tax year 2014" do
692
+
693
+ describe "from gross income of 0" do
694
+ let(:tax_year) { 2014 }
695
+ let(:income) { 0 }
696
+ its(:rate) { should be == Rational(0, 1) }
697
+ its(:gross_income) { should be == 0 }
698
+ its(:net_income) { should be == 0 }
699
+ its(:taxes) { should be == 0 }
700
+ end
701
+
702
+ describe "from gross income of 1000" do
703
+ let(:tax_year) { 2014 }
704
+ let(:income) { 1000 }
705
+ its(:rate) { should be == Rational(0, 1) }
706
+ its(:gross_income) { should be == 1000 }
707
+ its(:net_income) { should be == 1000 }
708
+ its(:taxes) { should be == 0 }
709
+ end
710
+
711
+ describe "from gross income of 10000" do
712
+ let(:tax_year) { 2014 }
713
+ let(:income) { 10000 }
714
+ its(:rate) { should be == Rational(26, 963) }
715
+ its(:gross_income) { should be == 10000 }
716
+ its(:net_income) { should be == "9729.92".to_d }
717
+ its(:taxes) { should be == "270.08".to_d }
718
+ end
719
+
720
+ describe "from gross income of 100000" do
721
+ let(:tax_year) { 2014 }
722
+ let(:income) { 100000 }
723
+ its(:rate) { should be == Rational(26, 73) }
724
+ its(:gross_income) { should be == 100000 }
725
+ its(:net_income) { should be == "64383.2".to_d }
726
+ its(:taxes) { should be == "35616.8".to_d }
727
+ end
728
+
729
+ describe "from gross income of 100000000" do
730
+ let(:tax_year) { 2014 }
731
+ let(:income) { 100000000 }
732
+ its(:rate) { should be == Rational(28, 59) }
733
+ its(:gross_income) { should be == 100000000 }
734
+ its(:net_income) { should be == "52541628.91".to_d }
735
+ its(:taxes) { should be == "47458371.09".to_d }
736
+ end
737
+
738
+ describe "from net income of 0" do
739
+ let(:type) { :net }
740
+ let(:tax_year) { 2014 }
741
+ let(:income) { 0 }
742
+ its(:rate) { should be == Rational(0, 1) }
743
+ its(:gross_income) { should be == 0 }
744
+ its(:net_income) { should be == 0 }
745
+ its(:taxes) { should be == 0 }
746
+ end
747
+
748
+ describe "from net income of 1000" do
749
+ let(:type) { :net }
750
+ let(:tax_year) { 2014 }
751
+ let(:income) { 1000 }
752
+ its(:rate) { should be == Rational(11, 200) }
753
+ its(:gross_income) { should be == "1058.2010582010582".to_d }
754
+ its(:net_income) { should be == 1000 }
755
+ its(:taxes) { should be == "58.2010582010582".to_d }
756
+ end
757
+
758
+ describe "from net income of 10000" do
759
+ let(:type) { :net }
760
+ let(:tax_year) { 2014 }
761
+ let(:income) { 10000 }
762
+ its(:rate) { should be == Rational(27, 329) }
763
+ its(:gross_income) { should be == "10894.010582010582".to_d }
764
+ its(:net_income) { should be == 10000 }
765
+ its(:taxes) { should be == "894.010582010582".to_d }
766
+ end
767
+
768
+ describe "from net income of 100000" do
769
+ let(:type) { :net }
770
+ let(:tax_year) { 2014 }
771
+ let(:income) { 100000 }
772
+ its(:rate) { should be == Rational(89, 228) }
773
+ its(:gross_income) { should be == "164027.10582010582".to_d }
774
+ its(:net_income) { should be == 100000 }
775
+ its(:taxes) { should be == "64027.10582010582".to_d }
776
+ end
777
+
778
+ describe "from net income of 100000000" do
779
+ let(:type) { :net }
780
+ let(:tax_year) { 2014 }
781
+ let(:income) { 100000000 }
782
+ its(:rate) { should be == Rational(99, 212) }
783
+ its(:gross_income) { should be == "187609628.82010582".to_d }
784
+ its(:net_income) { should be == 100000000 }
785
+ its(:taxes) { should be == "87609628.82010582".to_d }
786
+ end
79
787
  end
80
788
 
81
- describe "from net income of 100000000" do
82
- let(:type) { :net }
83
- let(:income) { 100000000 }
84
- its(:rate) { should be == Rational(99, 212) }
85
- its(:gross_income) { should be == "187609588.82010582".to_d }
86
- its(:net_income) { should be == 100000000 }
87
- its(:taxes) { should be == "87609588.82010582".to_d }
789
+ describe "tax year 2015" do
790
+
791
+ describe "from gross income of 0" do
792
+ let(:tax_year) { 2015 }
793
+ let(:income) { 0 }
794
+ its(:rate) { should be == Rational(0, 1) }
795
+ its(:gross_income) { should be == 0 }
796
+ its(:net_income) { should be == 0 }
797
+ its(:taxes) { should be == 0 }
798
+ end
799
+
800
+ describe "from gross income of 1000" do
801
+ let(:tax_year) { 2015 }
802
+ let(:income) { 1000 }
803
+ its(:rate) { should be == Rational(0, 1) }
804
+ its(:gross_income) { should be == 1000 }
805
+ its(:net_income) { should be == 1000 }
806
+ its(:taxes) { should be == 0 }
807
+ end
808
+
809
+ describe "from gross income of 10000" do
810
+ let(:tax_year) { 2015 }
811
+ let(:income) { 10000 }
812
+ its(:rate) { should be == Rational(1, 40) }
813
+ its(:gross_income) { should be == 10000 }
814
+ its(:net_income) { should be == "9749.965".to_d }
815
+ its(:taxes) { should be == "250.035".to_d }
816
+ end
817
+
818
+ describe "from gross income of 100000" do
819
+ let(:tax_year) { 2015 }
820
+ let(:income) { 100000 }
821
+ its(:rate) { should be == Rational(21, 59) }
822
+ its(:gross_income) { should be == 100000 }
823
+ its(:net_income) { should be == "64406.41".to_d }
824
+ its(:taxes) { should be == "35593.59".to_d }
825
+ end
826
+
827
+ describe "from gross income of 100000000" do
828
+ let(:tax_year) { 2015 }
829
+ let(:income) { 100000000 }
830
+ its(:rate) { should be == Rational(28, 59) }
831
+ its(:gross_income) { should be == 100000000 }
832
+ its(:net_income) { should be == "52541652.12".to_d }
833
+ its(:taxes) { should be == "47458347.88".to_d }
834
+ end
835
+
836
+ describe "from net income of 0" do
837
+ let(:type) { :net }
838
+ let(:tax_year) { 2015 }
839
+ let(:income) { 0 }
840
+ its(:rate) { should be == Rational(0, 1) }
841
+ its(:gross_income) { should be == 0 }
842
+ its(:net_income) { should be == 0 }
843
+ its(:taxes) { should be == 0 }
844
+ end
845
+
846
+ describe "from net income of 1000" do
847
+ let(:type) { :net }
848
+ let(:tax_year) { 2015 }
849
+ let(:income) { 1000 }
850
+ its(:rate) { should be == Rational(11, 200) }
851
+ its(:gross_income) { should be == "1058.2010582010582".to_d }
852
+ its(:net_income) { should be == 1000 }
853
+ its(:taxes) { should be == "58.2010582010582".to_d }
854
+ end
855
+
856
+ describe "from net income of 10000" do
857
+ let(:type) { :net }
858
+ let(:tax_year) { 2015 }
859
+ let(:income) { 10000 }
860
+ its(:rate) { should be == Rational(69, 862) }
861
+ its(:gross_income) { should be == "10870.010582010582".to_d }
862
+ its(:net_income) { should be == 10000 }
863
+ its(:taxes) { should be == "870.010582010582".to_d }
864
+ end
865
+
866
+ describe "from net income of 100000" do
867
+ let(:type) { :net }
868
+ let(:tax_year) { 2015 }
869
+ let(:income) { 100000 }
870
+ its(:rate) { should be == Rational(199, 510) }
871
+ its(:gross_income) { should be == "163989.10582010582".to_d }
872
+ its(:net_income) { should be == 100000 }
873
+ its(:taxes) { should be == "63989.10582010582".to_d }
874
+ end
875
+
876
+ describe "from net income of 100000000" do
877
+ let(:type) { :net }
878
+ let(:tax_year) { 2015 }
879
+ let(:income) { 100000000 }
880
+ its(:rate) { should be == Rational(99, 212) }
881
+ its(:gross_income) { should be == "187609588.82010582".to_d }
882
+ its(:net_income) { should be == 100000000 }
883
+ its(:taxes) { should be == "87609588.82010582".to_d }
884
+ end
88
885
  end
89
886
  end