test/source-tests.rb in user-choices-1.1.3 vs test/source-tests.rb in user-choices-1.1.4

- old
+ new

@@ -1,12 +1,12 @@ -load "set-standalone-test-paths.rb" unless $started_from_rakefile require 'test/unit' require 's4t-utils' require 'builder' require 'user-choices' include S4tUtils -require 'extensions/string' +set_test_paths(__FILE__) +require 'tempfile' # The general contract of these objects. class TestAbstractSource < Test::Unit::TestCase include UserChoices @@ -310,10 +310,19 @@ choices.fill choices.apply(:maximum => [Conversion.for(:integer)]) assert_equal(53, choices[:maximum]) end end + + def test_complete_paths_to_config_file_are_allowed + tempfile = Tempfile.new('path-test') + tempfile.puts(@some_xml) + tempfile.close + choices = XmlConfigFileSource.new.from_complete_path(tempfile.path) + choices.fill + assert_equal('53', choices[:maximum]) + end def test_unmentioned_values_are_nil with_local_config_file('.amazonrc', @some_xml) do @@ -386,10 +395,10 @@ | maximum: 53 | host: | - a.com | - b.com | list-arg: 1,2, 3 - ".trim('|') + ".without_pretty_indentation('|') end def test_string_assurance choices = YamlConfigFileSource.new a = [1]