sapor 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/create_installation_package.sh +1 -1
- data/bin/install.sh +1 -1
- data/bin/sapor.rb +1 -1
- data/bin/sapor.sh +1 -1
- data/data/hu/hungary-2014.txt +1 -1
- data/data/hu/hungary_2014_screen_scraper.rb +1 -1
- data/data/hu/hungary_2014_to_psv.rb +2 -2
- data/data/ie/2016-04-28_general-election-2016-candidate-details-csv_en.csv +552 -0
- data/data/ie/ireland_2016_to_psv.rb +138 -0
- data/data/no/2020-01-01_partifordeling_1_st_2017.csv +335 -0
- data/data/no/norway_2017_to_psv.rb +61 -0
- data/data/pl/poland_2015_to_psv.rb +2 -2
- data/data/pl/poland_2015_to_psv_with_ko_and_rsw.rb +2 -2
- data/data/pl/poland_2015_to_psv_with_ko_konf_kp_l_and_zp.rb +2 -2
- data/data/pl/poland_2015_to_psv_with_ko_sld_and_wi.rb +2 -2
- data/data/pl/poland_2015_to_psv_with_sld.rb +2 -2
- data/data/pl/poland_2015_to_psv_with_sld_and_wi.rb +2 -2
- data/data/uk/united_kingdom_2015_to_psv.rb +2 -2
- data/data/uk/united_kingdom_2017_to_psv.rb +2 -2
- data/data/uk/united_kingdom_2017_to_psv_with_brexit_and_chuk.rb +2 -2
- data/data/uk/united_kingdom_2017_to_psv_with_tig.rb +2 -2
- data/lib/sapor.rb +3 -3
- data/lib/sapor/binomials_cache.rb +1 -1
- data/lib/sapor/combinations_distribution.rb +1 -1
- data/lib/sapor/denominators.rb +1 -1
- data/lib/sapor/dichotomies.rb +1 -1
- data/lib/sapor/dichotomy.rb +1 -1
- data/lib/sapor/first_past_the_post.rb +1 -1
- data/lib/sapor/largest_remainder.rb +1 -1
- data/lib/sapor/log4r_logger.rb +1 -1
- data/lib/sapor/log_facade.rb +1 -1
- data/lib/sapor/many_past_the_post.rb +113 -0
- data/lib/sapor/multi_district_leveled_proportional.rb +1 -1
- data/lib/sapor/multi_district_proportional.rb +1 -1
- data/lib/sapor/multi_district_variable_threshold_proportional.rb +1 -1
- data/lib/sapor/number_formatter.rb +1 -1
- data/lib/sapor/options.rb +1 -1
- data/lib/sapor/poll.rb +12 -14
- data/lib/sapor/polychotomy.rb +1 -1
- data/lib/sapor/pseudorandom_multirange_enumerator.rb +1 -1
- data/lib/sapor/referendum_polychotomy.rb +1 -1
- data/lib/sapor/regional_data/area.rb +28 -10
- data/lib/sapor/regional_data/austria.rb +1 -1
- data/lib/sapor/regional_data/belgium-brussels-2014.psv +1 -1
- data/lib/sapor/regional_data/belgium-brussels-20190526.psv +1 -1
- data/lib/sapor/regional_data/belgium-flanders-2014.psv +1 -1
- data/lib/sapor/regional_data/belgium-flanders-20190526.psv +1 -1
- data/lib/sapor/regional_data/belgium-wallonia-2014.psv +1 -1
- data/lib/sapor/regional_data/belgium-wallonia-20190526.psv +1 -1
- data/lib/sapor/regional_data/belgium.rb +1 -1
- data/lib/sapor/regional_data/belgium_brussels.rb +1 -1
- data/lib/sapor/regional_data/belgium_flanders.rb +1 -1
- data/lib/sapor/regional_data/belgium_wallonia.rb +1 -1
- data/lib/sapor/regional_data/catalonia-2012-2015.psv +1 -1
- data/lib/sapor/regional_data/catalonia-2012.psv +1 -1
- data/lib/sapor/regional_data/catalonia-2015-jxcat.psv +1 -1
- data/lib/sapor/regional_data/catalonia-2015-no-jxsi.psv +1 -1
- data/lib/sapor/regional_data/catalonia-2015.psv +1 -1
- data/lib/sapor/regional_data/catalonia-20171221-with-vox.psv +67 -0
- data/lib/sapor/regional_data/catalonia-20171221.psv +61 -0
- data/lib/sapor/regional_data/catalonia.rb +57 -29
- data/lib/sapor/regional_data/denmark-20150618-with-e-and-p.psv +1 -1
- data/lib/sapor/regional_data/denmark-20150618-with-e.psv +1 -1
- data/lib/sapor/regional_data/denmark-20150618-with-p.psv +1 -1
- data/lib/sapor/regional_data/denmark-20150618.psv +1 -1
- data/lib/sapor/regional_data/denmark.rb +1 -1
- data/lib/sapor/regional_data/denmark_with_e.rb +1 -1
- data/lib/sapor/regional_data/denmark_with_e_and_p.rb +1 -1
- data/lib/sapor/regional_data/denmark_with_p.rb +1 -1
- data/lib/sapor/regional_data/estonia.rb +1 -1
- data/lib/sapor/regional_data/european-union-great-britain-20140522-brexit-chuk.psv +1 -1
- data/lib/sapor/regional_data/european-union-great-britain-20140522.psv +1 -1
- data/lib/sapor/regional_data/european-union-great-britain-20190523.psv +1 -1
- data/lib/sapor/regional_data/european-union-ireland-2014-ia-ri-sd.psv +1 -1
- data/lib/sapor/regional_data/european-union-ireland-2014-ia-sd.psv +1 -1
- data/lib/sapor/regional_data/european-union-ireland-2014-ia.psv +1 -1
- data/lib/sapor/regional_data/european-union-ireland-2014-sd.psv +1 -1
- data/lib/sapor/regional_data/european-union-ireland-2014.psv +1 -1
- data/lib/sapor/regional_data/european-union-ireland-20190524-ia.psv +1 -1
- data/lib/sapor/regional_data/european-union-ireland-20190524.psv +1 -1
- data/lib/sapor/regional_data/european_union_27_austria.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_croatia.rb +4 -2
- data/lib/sapor/regional_data/european_union_27_denmark.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_estonia.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_finland.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_france.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_ireland.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_ireland_with_ia.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_italy.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_netherlands.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_poland.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_romania.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_slovakia.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_spain.rb +1 -1
- data/lib/sapor/regional_data/european_union_27_sweden.rb +1 -1
- data/lib/sapor/regional_data/european_union_austria.rb +1 -1
- data/lib/sapor/regional_data/european_union_bulgaria.rb +1 -1
- data/lib/sapor/regional_data/european_union_croatia.rb +4 -2
- data/lib/sapor/regional_data/european_union_cyprus.rb +1 -1
- data/lib/sapor/regional_data/european_union_czech_republic.rb +1 -1
- data/lib/sapor/regional_data/european_union_denmark.rb +1 -1
- data/lib/sapor/regional_data/european_union_estonia.rb +1 -1
- data/lib/sapor/regional_data/european_union_finland.rb +1 -1
- data/lib/sapor/regional_data/european_union_flanders.rb +1 -1
- data/lib/sapor/regional_data/european_union_france.rb +1 -1
- data/lib/sapor/regional_data/european_union_french_community_of_belgium.rb +1 -1
- data/lib/sapor/regional_data/european_union_germany.rb +1 -1
- data/lib/sapor/regional_data/european_union_great_britain.rb +1 -1
- data/lib/sapor/regional_data/european_union_greece.rb +1 -1
- data/lib/sapor/regional_data/european_union_hungary.rb +1 -1
- data/lib/sapor/regional_data/european_union_ireland.rb +1 -1
- data/lib/sapor/regional_data/european_union_ireland_with_ia.rb +1 -1
- data/lib/sapor/regional_data/european_union_italy.rb +1 -1
- data/lib/sapor/regional_data/european_union_latvia.rb +1 -1
- data/lib/sapor/regional_data/european_union_lithuania.rb +1 -1
- data/lib/sapor/regional_data/european_union_luxembourg.rb +1 -1
- data/lib/sapor/regional_data/european_union_malta.rb +1 -1
- data/lib/sapor/regional_data/european_union_netherlands.rb +1 -1
- data/lib/sapor/regional_data/european_union_northern_ireland.rb +1 -1
- data/lib/sapor/regional_data/european_union_poland.rb +1 -1
- data/lib/sapor/regional_data/european_union_portugal.rb +1 -1
- data/lib/sapor/regional_data/european_union_romania.rb +1 -1
- data/lib/sapor/regional_data/european_union_slovakia.rb +1 -1
- data/lib/sapor/regional_data/european_union_slovenia.rb +1 -1
- data/lib/sapor/regional_data/european_union_spain.rb +1 -1
- data/lib/sapor/regional_data/european_union_sweden.rb +1 -1
- data/lib/sapor/regional_data/finland-20150419-with-sin.psv +1 -1
- data/lib/sapor/regional_data/finland-20150419.psv +1 -1
- data/lib/sapor/regional_data/finland.rb +1 -1
- data/lib/sapor/regional_data/finland_with_sin.rb +1 -1
- data/lib/sapor/regional_data/flanders-2014.psv +1 -1
- data/lib/sapor/regional_data/flanders-20190526.psv +1 -1
- data/lib/sapor/regional_data/flanders.rb +1 -1
- data/lib/sapor/regional_data/france.rb +1 -1
- data/lib/sapor/regional_data/greece.rb +1 -1
- data/lib/sapor/regional_data/hungary-2014.psv +1 -1
- data/lib/sapor/regional_data/hungary.rb +1 -1
- data/lib/sapor/regional_data/iceland-20161029-midflokkurinn.psv +1 -1
- data/lib/sapor/regional_data/iceland-20161029.psv +1 -1
- data/lib/sapor/regional_data/iceland-20171028-with-j.psv +94 -0
- data/lib/sapor/regional_data/iceland-20171028.psv +1 -1
- data/lib/sapor/regional_data/iceland.rb +32 -16
- data/lib/sapor/regional_data/ireland-20160226-2020-candidates.psv +322 -0
- data/lib/sapor/regional_data/ireland-20160226-2020.psv +344 -0
- data/lib/sapor/regional_data/ireland-20160226.psv +348 -0
- data/lib/sapor/regional_data/ireland.rb +165 -0
- data/lib/sapor/regional_data/latvia-20141004-kpv-p-par.psv +1 -1
- data/lib/sapor/regional_data/latvia-20141004-kpv-par.psv +1 -1
- data/lib/sapor/regional_data/latvia-20141004-kpv.psv +1 -1
- data/lib/sapor/regional_data/latvia-20141004.psv +1 -1
- data/lib/sapor/regional_data/latvia-20181006.psv +1 -1
- data/lib/sapor/regional_data/latvia.rb +1 -1
- data/lib/sapor/regional_data/luxembourg-20131020.psv +1 -1
- data/lib/sapor/regional_data/luxembourg-20181014.psv +1 -1
- data/lib/sapor/regional_data/luxembourg.rb +1 -1
- data/lib/sapor/regional_data/netherlands.rb +1 -1
- data/lib/sapor/regional_data/norway-20170911.psv +331 -0
- data/lib/sapor/regional_data/norway.rb +44 -339
- data/lib/sapor/regional_data/norwegian_municipality.rb +1 -1
- data/lib/sapor/regional_data/poland-20151025-with-ko-and-l-without-n-po-r-and-zl.psv +1 -1
- data/lib/sapor/regional_data/poland-20151025-with-ko-konf-kp-l-and-zp-without-k-k15-n-pis-po-psl-r-and-zl.psv +1 -1
- data/lib/sapor/regional_data/poland-20151025-with-ko-sld-and-wi-without-n-po-and-zl.psv +1 -1
- data/lib/sapor/regional_data/poland-20151025-with-sld-and-wi-without-zl.psv +1 -1
- data/lib/sapor/regional_data/poland-20151025-with-sld-without-zl.psv +1 -1
- data/lib/sapor/regional_data/poland-20151025.psv +1 -1
- data/lib/sapor/regional_data/poland.rb +1 -1
- data/lib/sapor/regional_data/poland_with_ko_and_l_without_n_po_r_and_zl.rb +1 -1
- data/lib/sapor/regional_data/poland_with_ko_konf_kp_l_and_zp_without_k_k15_n_pis_po_psl_r_and_zl.rb +1 -1
- data/lib/sapor/regional_data/poland_with_ko_sld_and_wi_without_n_po_and_zl.rb +1 -1
- data/lib/sapor/regional_data/poland_with_sld_and_wi_without_zl.rb +1 -1
- data/lib/sapor/regional_data/poland_with_sld_without_zl.rb +1 -1
- data/lib/sapor/regional_data/portugal-20151004-with-a-and-ch-without-paf.psv +1 -1
- data/lib/sapor/regional_data/portugal-20151004-with-a-and-il-without-paf.psv +1 -1
- data/lib/sapor/regional_data/portugal-20151004-with-a-ch-and-il-without-paf.psv +1 -1
- data/lib/sapor/regional_data/portugal-20151004-with-a-without-paf.psv +1 -1
- data/lib/sapor/regional_data/portugal-20151004-with-ch-and-il-without-paf.psv +1 -1
- data/lib/sapor/regional_data/portugal-20151004-without-paf.psv +1 -1
- data/lib/sapor/regional_data/portugal-20151004.psv +1 -1
- data/lib/sapor/regional_data/portugal.rb +1 -1
- data/lib/sapor/regional_data/portugal_with_a_and_ch_without_paf.rb +1 -1
- data/lib/sapor/regional_data/portugal_with_a_and_il_without_paf.rb +1 -1
- data/lib/sapor/regional_data/portugal_with_a_ch_and_il_without_paf.rb +1 -1
- data/lib/sapor/regional_data/portugal_with_a_without_paf.rb +1 -1
- data/lib/sapor/regional_data/portugal_with_ch_and_il_without_paf.rb +1 -1
- data/lib/sapor/regional_data/portugal_without_paf.rb +1 -1
- data/lib/sapor/regional_data/slovakia.rb +1 -1
- data/lib/sapor/regional_data/slovenia.rb +1 -1
- data/lib/sapor/regional_data/spain-20160626.psv +1 -1
- data/lib/sapor/regional_data/spain.rb +1 -1
- data/lib/sapor/regional_data/sweden.rb +1 -1
- data/lib/sapor/regional_data/sweden_20140914.rb +1 -1
- data/lib/sapor/regional_data/united_kingdom-2015.psv +1 -1
- data/lib/sapor/regional_data/united_kingdom-20170608-brexit-chuk.psv +1 -1
- data/lib/sapor/regional_data/united_kingdom-20170608-brexit.psv +1 -1
- data/lib/sapor/regional_data/united_kingdom-20170608-tig.psv +1 -1
- data/lib/sapor/regional_data/united_kingdom-20170608.psv +1 -1
- data/lib/sapor/regional_data/united_kingdom.rb +1 -1
- data/lib/sapor/regional_data/united_kingdom_with_brexit.rb +1 -1
- data/lib/sapor/regional_data/united_kingdom_with_brexit_and_chuk.rb +1 -1
- data/lib/sapor/regional_data/united_kingdom_with_tig.rb +1 -1
- data/lib/sapor/regional_data/utopia.rb +1 -1
- data/lib/sapor/regional_data/wallonia-2014.psv +1 -1
- data/lib/sapor/regional_data/wallonia-20190526.psv +1 -1
- data/lib/sapor/regional_data/wallonia.rb +1 -1
- data/lib/sapor/representatives_polychotomy.rb +1 -1
- data/lib/sapor/single_district_proportional.rb +1 -1
- data/sapor.gemspec +2 -2
- data/spec/integration/area_spec.rb +1 -1
- data/spec/integration/poll_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/area_spec.rb +1 -1
- data/spec/unit/austria_spec.rb +1 -1
- data/spec/unit/belgium_brussels_spec.rb +1 -1
- data/spec/unit/belgium_flanders_spec.rb +1 -1
- data/spec/unit/belgium_spec.rb +1 -1
- data/spec/unit/belgium_wallonia_spec.rb +1 -1
- data/spec/unit/binomials_cache_spec.rb +1 -1
- data/spec/unit/catalonia_spec.rb +13 -26
- data/spec/unit/catalonia_with_vox_spec.rb +62 -0
- data/spec/unit/combinations_distribution_spec.rb +1 -1
- data/spec/unit/denmark_spec.rb +1 -1
- data/spec/unit/denmark_with_e_and_p_spec.rb +1 -1
- data/spec/unit/denmark_with_e_spec.rb +1 -1
- data/spec/unit/denmark_with_p_spec.rb +1 -1
- data/spec/unit/denominators_spec.rb +1 -1
- data/spec/unit/dichotomies_spec.rb +1 -1
- data/spec/unit/dichotomy_spec.rb +1 -1
- data/spec/unit/estonia_spec.rb +1 -1
- data/spec/unit/european_union_27_austria_spec.rb +1 -1
- data/spec/unit/european_union_27_croatia_spec.rb +1 -1
- data/spec/unit/european_union_27_denmark_spec.rb +1 -1
- data/spec/unit/european_union_27_estonia_spec.rb +1 -1
- data/spec/unit/european_union_27_finland_spec.rb +1 -1
- data/spec/unit/european_union_27_france_spec.rb +1 -1
- data/spec/unit/european_union_27_ireland_spec.rb +1 -1
- data/spec/unit/european_union_27_ireland_with_ia_spec.rb +1 -1
- data/spec/unit/european_union_27_italy_spec.rb +1 -1
- data/spec/unit/european_union_27_netherlands_spec.rb +1 -1
- data/spec/unit/european_union_27_poland_spec.rb +1 -1
- data/spec/unit/european_union_27_romania_spec.rb +1 -1
- data/spec/unit/european_union_27_slovakia_spec.rb +1 -1
- data/spec/unit/european_union_27_spain_spec.rb +1 -1
- data/spec/unit/european_union_27_sweden_spec.rb +1 -1
- data/spec/unit/european_union_austria_spec.rb +1 -1
- data/spec/unit/european_union_bulgaria_spec.rb +1 -1
- data/spec/unit/european_union_croatia_spec.rb +1 -1
- data/spec/unit/european_union_cyprus_spec.rb +1 -1
- data/spec/unit/european_union_czech_republic_spec.rb +1 -1
- data/spec/unit/european_union_denmark_spec.rb +1 -1
- data/spec/unit/european_union_estonia_spec.rb +1 -1
- data/spec/unit/european_union_finland_spec.rb +1 -1
- data/spec/unit/european_union_flanders_spec.rb +1 -1
- data/spec/unit/european_union_france_spec.rb +1 -1
- data/spec/unit/european_union_french_community_of_belgium_spec.rb +1 -1
- data/spec/unit/european_union_germany_spec.rb +1 -1
- data/spec/unit/european_union_great_britain_spec.rb +1 -1
- data/spec/unit/european_union_greece_spec.rb +1 -1
- data/spec/unit/european_union_hungary_spec.rb +1 -1
- data/spec/unit/european_union_ireland_spec.rb +1 -1
- data/spec/unit/european_union_ireland_with_ia_spec.rb +1 -1
- data/spec/unit/european_union_italy_spec.rb +1 -1
- data/spec/unit/european_union_latvia_spec.rb +1 -1
- data/spec/unit/european_union_lithuania_spec.rb +1 -1
- data/spec/unit/european_union_luxembourg_spec.rb +1 -1
- data/spec/unit/european_union_malta_spec.rb +1 -1
- data/spec/unit/european_union_netherlands_spec.rb +1 -1
- data/spec/unit/european_union_northern_ireland_spec.rb +1 -1
- data/spec/unit/european_union_poland_spec.rb +1 -1
- data/spec/unit/european_union_portugal_spec.rb +1 -1
- data/spec/unit/european_union_romania_spec.rb +1 -1
- data/spec/unit/european_union_slovakia_spec.rb +1 -1
- data/spec/unit/european_union_slovenia_spec.rb +1 -1
- data/spec/unit/european_union_spain_spec.rb +1 -1
- data/spec/unit/european_union_sweden_spec.rb +1 -1
- data/spec/unit/finland_spec.rb +1 -1
- data/spec/unit/finland_with_sin_spec.rb +1 -1
- data/spec/unit/first_past_the_post_spec.rb +1 -1
- data/spec/unit/flanders_spec.rb +1 -1
- data/spec/unit/france_spec.rb +1 -1
- data/spec/unit/greece_spec.rb +1 -1
- data/spec/unit/hungary_spec.rb +1 -1
- data/spec/unit/iceland_spec.rb +1 -1
- data/spec/unit/iceland_with_j_spec.rb +58 -0
- data/spec/unit/ireland_2016_spec.rb +62 -0
- data/spec/unit/ireland_spec.rb +62 -0
- data/spec/unit/largest_remainder_spec.rb +1 -1
- data/spec/unit/latvia_spec.rb +1 -1
- data/spec/unit/luxembourg_spec.rb +1 -1
- data/spec/unit/multi_district_leveled_proportional_spec.rb +1 -1
- data/spec/unit/multi_district_proportional_spec.rb +1 -1
- data/spec/unit/netherlands_spec.rb +1 -1
- data/spec/unit/norway_spec.rb +26 -21
- data/spec/unit/norwegian_municipality_spec.rb +1 -1
- data/spec/unit/number_formatter_spec.rb +1 -1
- data/spec/unit/poland_spec.rb +1 -1
- data/spec/unit/poland_with_ko_and_l_without_n_po_r_and_zl_spec.rb +1 -1
- data/spec/unit/poland_with_ko_konf_kp_l_and_zp_without_k_k15_n_pis_po_psl_r_and_zl_spec.rb +1 -1
- data/spec/unit/poland_with_ko_sld_and_wi_without_n_po_and_zl_spec.rb +1 -1
- data/spec/unit/poland_with_sld_and_wi_without_zl_spec.rb +1 -1
- data/spec/unit/poland_with_sld_without_zl_spec.rb +1 -1
- data/spec/unit/poll_spec.rb +1 -1
- data/spec/unit/portugal_spec.rb +1 -1
- data/spec/unit/portugal_with_a_and_ch_without_paf_spec.rb +1 -1
- data/spec/unit/portugal_with_a_and_il_without_paf_spec.rb +1 -1
- data/spec/unit/portugal_with_a_ch_and_il_without_paf_spec.rb +1 -1
- data/spec/unit/portugal_with_a_without_paf_spec.rb +1 -1
- data/spec/unit/portugal_with_ch_and_il_without_paf_spec.rb +1 -1
- data/spec/unit/portugal_without_paf_spec.rb +1 -1
- data/spec/unit/pseudorandom_multirange_enumerator_spec.rb +1 -1
- data/spec/unit/referendum_polychotomy_spec.rb +1 -1
- data/spec/unit/representatives_polychotomy_spec.rb +1 -1
- data/spec/unit/slovakia_spec.rb +1 -1
- data/spec/unit/slovenia_spec.rb +1 -1
- data/spec/unit/spain_spec.rb +1 -1
- data/spec/unit/sweden_20140914_spec.rb +1 -1
- data/spec/unit/sweden_spec.rb +1 -1
- data/spec/unit/united_kingdom_spec.rb +1 -1
- data/spec/unit/united_kingdom_with_brexit_and_chuk_spec.rb +1 -1
- data/spec/unit/united_kingdom_with_brexit_spec.rb +1 -1
- data/spec/unit/united_kingdom_with_tig_spec.rb +1 -1
- data/spec/unit/wallonia_spec.rb +1 -1
- metadata +23 -4
- data/lib/sapor/regional_data/catalonia-jxcat.rb +0 -109
- data/lib/sapor/regional_data/catalonia-no-jxsi.rb +0 -96
data/spec/unit/finland_spec.rb
CHANGED
data/spec/unit/flanders_spec.rb
CHANGED
data/spec/unit/france_spec.rb
CHANGED
data/spec/unit/greece_spec.rb
CHANGED
data/spec/unit/hungary_spec.rb
CHANGED
data/spec/unit/iceland_spec.rb
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
#
|
3
|
+
# Statistical Analysis of Polling Results (SAPoR)
|
4
|
+
# Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
|
5
|
+
#
|
6
|
+
# This file is part of SAPoR.
|
7
|
+
#
|
8
|
+
# SAPoR is free software: you can redistribute it and/or modify it under the
|
9
|
+
# terms of the GNU General Public License as published by the Free Software
|
10
|
+
# Foundation, either version 3 of the License, or (at your option) any later
|
11
|
+
# version.
|
12
|
+
#
|
13
|
+
# SAPoR is distributed in the hope that it will be useful, but WITHOUT ANY
|
14
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
15
|
+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
16
|
+
#
|
17
|
+
# You can find a copy of the GNU General Public License in /doc/gpl.txt
|
18
|
+
#
|
19
|
+
|
20
|
+
require 'spec_helper'
|
21
|
+
|
22
|
+
describe Sapor::IcelandWithJ, '#area_code' do
|
23
|
+
it 'returns IS∪{J} as the area code' do
|
24
|
+
expect(Sapor::IcelandWithJ.instance.area_code).to eq('IS∪{J}')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe Sapor::IcelandWithJ, '#no_of_seats' do
|
29
|
+
it 'returns 63 as the number of seats' do
|
30
|
+
expect(Sapor::IcelandWithJ.instance.no_of_seats).to eq(63)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe Sapor::IcelandWithJ, '#population_size' do
|
35
|
+
it 'returns a population size of 195,204' do
|
36
|
+
expect(Sapor::IcelandWithJ.instance.population_size).to eq(196_246)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe Sapor::IcelandWithJ, '#seats' do
|
41
|
+
it 'calculates the adapted number of seats for the election of 2017 correctly' do
|
42
|
+
IcelandWithJ = Sapor::IcelandWithJ.instance
|
43
|
+
results = IcelandWithJ.overall_election_results_of_2017
|
44
|
+
seats = IcelandWithJ.seats(results)
|
45
|
+
expect(seats['Sjálfstæðisflokkurinn']).to eq(16 - 1)
|
46
|
+
expect(seats['Vinstrihreyfingin – grænt framboð']).to eq(11)
|
47
|
+
expect(seats['Framsóknarflokkurinn']).to eq(8 - 1)
|
48
|
+
expect(seats['Samfylkingin']).to eq(7)
|
49
|
+
expect(seats['Miðflokkurinn']).to eq(7 - 1)
|
50
|
+
expect(seats['Píratar']).to eq(6 - 1)
|
51
|
+
expect(seats['Flokkur fólksins']).to eq(4)
|
52
|
+
expect(seats['Sósíalistaflokkur Íslands']).to eq(4)
|
53
|
+
expect(seats['Viðreisn']).to eq(4)
|
54
|
+
expect(seats['Björt framtíð']).to eq(0)
|
55
|
+
expect(seats['Dögun']).to eq(0)
|
56
|
+
expect(seats['Alþýðufylkingin']).to eq(0)
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
|
2
|
+
#
|
3
|
+
# Statistical Analysis of Polling Results (SAPoR)
|
4
|
+
# Copyright (C) 2020 Filip van Laenen <f.a.vanlaenen@ieee.org>
|
5
|
+
#
|
6
|
+
# This file is part of SAPoR.
|
7
|
+
#
|
8
|
+
# SAPoR is free software: you can redistribute it and/or modify it under the
|
9
|
+
# terms of the GNU General Public License as published by the Free Software
|
10
|
+
# Foundation, either version 3 of the License, or (at your option) any later
|
11
|
+
# version.
|
12
|
+
#
|
13
|
+
# SAPoR is distributed in the hope that it will be useful, but WITHOUT ANY
|
14
|
+
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
15
|
+
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
16
|
+
#
|
17
|
+
# You can find a copy of the GNU General Public License in /doc/gpl.txt
|
18
|
+
#
|
19
|
+
|
20
|
+
require 'spec_helper'
|
21
|
+
|
22
|
+
describe Sapor::Ireland2016, '#area_code' do
|
23
|
+
it 'returns IE as the area code' do
|
24
|
+
expect(Sapor::Ireland2016.instance.area_code).to eq('IE@2016')
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe Sapor::Ireland2016, '#no_of_seats' do
|
29
|
+
it 'returns 158 as the number of seats' do
|
30
|
+
expect(Sapor::Ireland2016.instance.no_of_seats).to eq(158)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe Sapor::Ireland2016, '#population_size' do
|
35
|
+
it 'returns a population size of 2,132,895' do
|
36
|
+
expect(Sapor::Ireland2016.instance.population_size).to eq(2_132_895)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe Sapor::Ireland2016, '#seats' do
|
41
|
+
it 'calculates the number of seats for the election of 2016 correctly' do
|
42
|
+
Ireland2016 = Sapor::Ireland2016.instance
|
43
|
+
results = Ireland2016.overall_election_results_of_2016
|
44
|
+
seats = Ireland2016.seats(results)
|
45
|
+
expect(seats['Fine Gael']).to eq(49 - 1)
|
46
|
+
expect(seats['Fianna Fáil']).to eq(44 + 3)
|
47
|
+
expect(seats['Sinn Féin']).to eq(23 + 4)
|
48
|
+
expect(seats['Labour Party']).to eq(7)
|
49
|
+
expect(seats['Solidarity–People Before Profit']).to eq(6 - 1)
|
50
|
+
expect(seats['Independents 4 Change']).to eq(4 - 1)
|
51
|
+
expect(seats['Social Democrats']).to eq(3)
|
52
|
+
expect(seats['Green Party/Comhaontas Glas']).to eq(2 - 1)
|
53
|
+
expect(seats['Catholic Democrats']).to eq(0)
|
54
|
+
expect(seats['Communist Party of Ireland']).to eq(0)
|
55
|
+
expect(seats['Direct Democracy Ireland']).to eq(0)
|
56
|
+
expect(seats['Fís Nua']).to eq(0)
|
57
|
+
expect(seats['Irish Democratic Party']).to eq(0)
|
58
|
+
expect(seats['Renua Ireland']).to eq(0)
|
59
|
+
expect(seats['Workers’ Party']).to eq(0)
|
60
|
+
expect(seats['Independent']).to eq(20 - 3)
|
61
|
+
end
|
62
|
+
end
|