Sha256: 65d3b3fc026d97c5e032a813ff7214ddf2d75ef84a506150eb84ecb0d2b4c76e
Contents?: true
Size: 1.12 KB
Versions: 8
Compression:
Stored size: 1.12 KB
Contents
require File.join(File.dirname(__FILE__), 'test_helper') require 'yaml' require 'hydra/proxy_config' class ProxyConfigTest < Test::Unit::TestCase context "proxy config" do should "fetch and parse yml from a file source" do assert_equal YAML::load_file("test/fixtures/config.yml"), Hydra::ProxyConfig.load(File.read("test/fixtures/proxy_config.yml")) end should "fetch and parse yml from a http source" do class Net::HTTP def self.get(path) return File.new("test/fixtures/config.yml", "r").read end end assert_equal YAML::load_file("test/fixtures/config.yml"), Hydra::ProxyConfig.load(File.read("test/fixtures/proxy_config_http.yml")) end should "raise exception when type is unknown" do assert_raise Hydra::UnknownProxyType do Hydra::ProxyConfig.load(File.read("test/fixtures/bad_proxy_config.yml")) end end end context "normal hydra config" do should "return unserialized configuration" do assert_equal YAML::load_file("test/fixtures/config.yml"), Hydra::ProxyConfig.load(File.read("test/fixtures/config.yml")) end end end
Version data entries
8 entries across 8 versions & 3 rubygems