From 27d38820a67751a898d5d17073adc556c4bb56a9 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 2 May 2012 10:44:34 +0100 Subject: Added configuration options for daytime_hours, dead_zone, and working_hours. --- test/tc_mauve_configuration.rb | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 test/tc_mauve_configuration.rb (limited to 'test/tc_mauve_configuration.rb') diff --git a/test/tc_mauve_configuration.rb b/test/tc_mauve_configuration.rb new file mode 100644 index 0000000..bbc1901 --- /dev/null +++ b/test/tc_mauve_configuration.rb @@ -0,0 +1,38 @@ +$:.unshift "../lib/" + +require 'th_mauve' +require 'mauve/configuration' + +class TcMauveConfiguration < Mauve::UnitTest + include Mauve + + def setup + setup_logger + end + + def teardown + teardown_logger + end + + def test_do_parse_range + [ + [[1.0...2.0], 1], + [[1.0...3.0], 1..2], + [[1.0...2.0], 1...2], + [[1.0...2.0, 4.0...7.0], [1, 4..6]], + [[1.0..1.0], 1.0], + [[1.0..2.0], 1.0..2.0], + [[1.0...2.0], 1.0...2.0], + [[1.0..1.0, 4.0..6.0], [1.0, 4.0..6.0]], + [[7.0...24.0, 0.0...7.0], 7..6], + [[6.0...7.0, 0.0...1.0], 6..0, 0...7], + [["x".."z", "a".."c"], "x".."c", "a".."z"] + ].each do |output, *input| + c = Configuration.new + assert_equal(output, c.__send__("do_parse_range",*input)) + end + end + +end + + -- cgit v1.2.1