require 'spec_helper' describe Mashery::Config do it "should raise an error on lack of key" do expect { Mashery::Config.new("spec/fixtures/config.no_key.yml") }.to raise_error(Mashery::ParamMissing, /key/) end it "should raise an error on lack of site_id" do expect { Mashery::Config.new("spec/fixtures/config.no_site_id.yml") }.to raise_error(Mashery::ParamMissing, /site_id/) end it "should raise an error on lack of secret" do expect { Mashery::Config.new("spec/fixtures/config.no_secret.yml") }.to raise_error(Mashery::ParamMissing, /secret/) end it "should raise an error on lack of host" do expect { Mashery::Config.new("spec/fixtures/config.no_host.yml") }.to raise_error(Mashery::ParamMissing, /host/) end it "should have site_id, key, secret, host and signature as attributes" do config = Mashery::Config.new("spec/fixtures/config.yml") expect do config.key config.secret config.signature config.host config.site_id end.to_not raise_error end end