Sha256: 4f07b111b3f52bc3fb04c7c0fb48dbe5d29fc9644af5f5705c6bc7159c68e008

Contents?: true

Size: 1.26 KB

Versions: 6

Compression:

Stored size: 1.26 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

6 entries across 6 versions & 1 rubygems

Version Path
jiralicious-0.4.3 spec/configuration_spec.rb
jiralicious-0.4.0 spec/configuration_spec.rb
jiralicious-0.3.0 spec/configuration_spec.rb
jiralicious-0.2.2 spec/configuration_spec.rb
jiralicious-0.2.1 spec/configuration_spec.rb
jiralicious-0.2.0 spec/configuration_spec.rb