test/config_test.rb in vines-0.1.1 vs test/config_test.rb in vines-0.2.0
- old
+ new
@@ -203,10 +203,11 @@
assert_equal Vines::Config::ClientPort, port.class
assert_equal '0.0.0.0', port.host
assert_equal 5222, port.port
assert_equal 131_072, port.max_stanza_size
assert_equal 5, port.max_resources_per_account
+ refute port.private_storage?
assert_equal Vines::Stream::Client, port.stream
assert_same config, port.config
assert_equal 1, config.ports.size
end
@@ -214,10 +215,11 @@
config = Vines::Config.new do
host 'wonderland.lit' do
storage(:fs) { dir '.' }
end
client '0.0.0.1', 42 do
+ private_storage true
max_stanza_size 60_000
max_resources_per_account 1
end
end
port = config.ports.first
@@ -225,10 +227,11 @@
assert_equal Vines::Config::ClientPort, port.class
assert_equal '0.0.0.1', port.host
assert_equal 42, port.port
assert_equal 60_000, port.max_stanza_size
assert_equal 1, port.max_resources_per_account
+ assert port.private_storage?
assert_equal Vines::Stream::Client, port.stream
assert_same config, port.config
assert_equal 1, config.ports.size
end
@@ -299,10 +302,13 @@
assert_equal Vines::Config::HttpPort, port.class
assert_equal '0.0.0.0', port.host
assert_equal 5280, port.port
assert_equal 131_072, port.max_stanza_size
assert_equal 5, port.max_resources_per_account
+ assert_equal File.join(Dir.pwd, 'web'), port.root
+ assert_equal '/xmpp', port.bind
+ refute port.private_storage?
assert_equal Vines::Stream::Http, port.stream
assert_same config, port.config
assert_equal 1, config.ports.size
end
@@ -310,20 +316,26 @@
config = Vines::Config.new do
host 'wonderland.lit' do
storage(:fs) { dir '.' }
end
http '0.0.0.1', 42 do
+ bind '/custom'
+ private_storage true
max_stanza_size 60_000
max_resources_per_account 1
+ root '/var/www/html'
end
end
port = config.ports.first
refute_nil port
assert_equal Vines::Config::HttpPort, port.class
assert_equal '0.0.0.1', port.host
assert_equal 42, port.port
assert_equal 60_000, port.max_stanza_size
assert_equal 1, port.max_resources_per_account
+ assert_equal '/var/www/html', port.root
+ assert_equal '/custom', port.bind
+ assert port.private_storage?
assert_equal Vines::Stream::Http, port.stream
assert_same config, port.config
assert_equal 1, config.ports.size
end