Sha256: 7468b66a564583e495292a4ea2d6696643068448ee245085122fa7a8cf59dc96

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

# encoding: utf-8
require "spec_helper"

describe Jiralicious::Configuration do
  before :each do
    Jiralicious.reset
  end

  it "sets the options to their default value" do
    Jiralicious.username.should be_nil
    Jiralicious.password.should be_nil
    Jiralicious.uri.should be_nil
    Jiralicious.api_version.should == "latest"
    Jiralicious.auth_type.should == :basic
  end

  it "allows setting of options in a block" do
    Jiralicious.configure do |config|
      config.username = "jstewart"
      config.password = "derp"
      config.uri = "http://example.com/foo/bar"
      config.api_version = "2.0aplha"
      config.auth_type = :cookie_session
    end

    Jiralicious.username.should == "jstewart"
    Jiralicious.password.should == "derp"
    Jiralicious.uri.should == "http://example.com/foo/bar"
    Jiralicious.api_version.should == "2.0aplha"
    Jiralicious.auth_type.should == :cookie_session
  end

  it "loads the yml in the specified format into the configuation variables" do
    Jiralicious.load_yml(jira_yml)
    Jiralicious.username.should == "jira_admin"
    Jiralicious.password.should == "jira_admin"
    Jiralicious.uri.should == "http://localhost:8080"
    Jiralicious.api_version.should == "latest"
    Jiralicious.auth_type.should == :basic
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jiralicious-0.5.0 spec/configuration_spec.rb