Sha256: 673a208ea66188f34598692e3bc5410f611217f6819d7ad711d52411d982f066

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

describe Masheri::Config do
  it "should raise an error on lack of key" do
    expect {
      Masheri::Config.new("spec/fixtures/config.no_key.yml")
    }.to raise_error(Masheri::ParamMissing, /key/)
  end

  it "should raise an error on lack of site_id" do
    expect {
      Masheri::Config.new("spec/fixtures/config.no_site_id.yml")
    }.to raise_error(Masheri::ParamMissing, /site_id/)
  end

  it "should raise an error on lack of secret" do
    expect {
      Masheri::Config.new("spec/fixtures/config.no_secret.yml")
    }.to raise_error(Masheri::ParamMissing, /secret/)
  end

  it "should raise an error on lack of host" do
    expect {
      Masheri::Config.new("spec/fixtures/config.no_host.yml")
    }.to raise_error(Masheri::ParamMissing, /host/)
  end

  it "should have site_id, key, secret, host and signature as attributes" do
    config = Masheri::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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
masheri-0.6.1 spec/masheri/config_spec.rb
masheri-0.6.0 spec/masheri/config_spec.rb