diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-04-23 11:37:38 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-04-23 11:37:38 +0100 |
commit | ca99b0dff974d2fc841d7132d03b3ad1d1bf9b1e (patch) | |
tree | 69f949ec5c8a3396222815eacf9109d516de8c84 /test/tc_mauve_configuration_builder.rb | |
parent | c3592bdf6fce6f234de37959c677f75d97b1134d (diff) |
People/PeopleLists can now specify individualy notification times/frequencies
* Added PeopleList builder
* Added Person#during, PeopleList#during, Person#every, PeopleList#every
* Notification now uses #during/#every from the Person/PeopleList if nothing
was specified
* Added tests
Diffstat (limited to 'test/tc_mauve_configuration_builder.rb')
-rw-r--r-- | test/tc_mauve_configuration_builder.rb | 54 |
1 files changed, 1 insertions, 53 deletions
diff --git a/test/tc_mauve_configuration_builder.rb b/test/tc_mauve_configuration_builder.rb index faa0bfa..1288b5d 100644 --- a/test/tc_mauve_configuration_builder.rb +++ b/test/tc_mauve_configuration_builder.rb @@ -3,7 +3,7 @@ $:.unshift "../lib/" require 'th_mauve' require 'mauve/configuration_builder' -class TcMauveConfigurationBuildersPeopleAndSourceLists < Mauve::UnitTest +class TcMauveConfigurationBuilder < Mauve::UnitTest def setup setup_logger @@ -13,58 +13,6 @@ class TcMauveConfigurationBuildersPeopleAndSourceLists < Mauve::UnitTest teardown_logger end - def test_people_list - config =<<EOF -people_list "team sky", %w( - geraint - edvald - bradley - rigoberto - ben -) - -people_list "garmin-cervelo", %w( - thor - ryder - tyler - julian -) - -EOF - x = nil - assert_nothing_raised { x = Mauve::ConfigurationBuilder.parse(config) } - assert_equal(2, x.people_lists.keys.length) - assert_equal(["team sky","garmin-cervelo"].sort,x.people_lists.keys.sort) - assert_equal(%w(geraint edvald bradley rigoberto ben), x.people_lists["team sky"].list) - - end - - def test_duplicate_people_list - - config=<<EOF - -people_list "htc-highroad", - ["mark c", "mark r", "Lars"] - -people_list "htc-highroad", - %w(Bernie Danny Lars) - -EOF - x = nil - # - # This should generate two warnings: - # * duplicate list - # * Lars already being on a list - # - assert_nothing_raised { x = Mauve::ConfigurationBuilder.parse(config) } - - assert_match(/Lars/, logger_pop()) - assert_match(/Duplicate/, logger_pop()) - - assert_equal(1, x.people_lists.keys.length) - assert_equal(["mark c","mark r","Lars","Bernie","Danny"].sort, x.people_lists["htc-highroad"].list.sort) - end - def test_source_list config =<<EOF source_list "sources", %w( |