summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/config.rb1
-rwxr-xr-xtest/tc_config.rb15
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/feed2imap/config.rb b/lib/feed2imap/config.rb
index 693d2d6..3b77c15 100644
--- a/lib/feed2imap/config.rb
+++ b/lib/feed2imap/config.rb
@@ -68,6 +68,7 @@ class F2IConfig
@imap_accounts = ImapAccounts::new
maildir_account = MaildirAccount::new
@conf['feeds'].each do |f|
+ f['name'] = f['name'].to_s
if f['disable'].nil?
uri = URI::parse(Array(f['target']).join(''))
path = URI::unescape(uri.path)
diff --git a/test/tc_config.rb b/test/tc_config.rb
index 255bdb7..8d5353c 100755
--- a/test/tc_config.rb
+++ b/test/tc_config.rb
@@ -54,6 +54,15 @@ feeds:
url: http://something
target: [ *target, "feed1" ]
EOF
+CONFINTNAME = <<EOF
+parts: text
+include-images: false
+prefix: &target "maildir:///tmp/Maildir/"
+feeds:
+ - name: 10
+ url: http://something
+ target: [ *target, "feed1" ]
+EOF
class ConfigTest < Test::Unit::TestCase
def test_cache
@@ -95,4 +104,10 @@ class ConfigTest < Test::Unit::TestCase
assert_equal "/tmp/Maildir/feed1", conf.feeds.first.folder
end
+ def test_integer_as_name
+ sio = StringIO.new CONFINTNAME
+ conf = F2IConfig.new(sio)
+ assert_equal "10", conf.feeds.first.name
+ end
+
end