aboutsummaryrefslogtreecommitdiff
path: root/test/tc_mauve_configuration.rb
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-05-02 10:44:34 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-05-02 10:44:34 +0100
commit27d38820a67751a898d5d17073adc556c4bb56a9 (patch)
tree6157be1229f0c5ea7f8f237370ede914cf7e2f95 /test/tc_mauve_configuration.rb
parente6c1341540eb4c08b1cbfef46cf2360489b27bd0 (diff)
Added configuration options for daytime_hours, dead_zone, and working_hours.
Diffstat (limited to 'test/tc_mauve_configuration.rb')
-rw-r--r--test/tc_mauve_configuration.rb38
1 files changed, 38 insertions, 0 deletions
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
+
+