Sha256: 637acbd61b3b8b1de9368a0cec01bc73b30379663283babb7a017b4e09ff607f

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

describe Gitlab do
  after { Gitlab.reset }

  describe ".client" do
    it "should be a Gitlab::Client" do
      Gitlab.client.should be_a Gitlab::Client
    end
  end

  describe ".endpoint=" do
    it "should set endpoint" do
      Gitlab.endpoint = 'https://api.example.com'
      Gitlab.endpoint.should == 'https://api.example.com'
    end
  end

  describe ".private_token=" do
    it "should set private_token" do
      Gitlab.private_token = 'secret'
      Gitlab.private_token.should == 'secret'
    end
  end

  describe ".user_agent" do
    it "should return default user_agent" do
      Gitlab.user_agent.should == Gitlab::Configuration::DEFAULT_USER_AGENT
    end
  end

  describe ".user_agent=" do
    it "should set user_agent" do
      Gitlab.user_agent = 'Custom User Agent'
      Gitlab.user_agent.should == 'Custom User Agent'
    end
  end

  describe ".configure" do
    Gitlab::Configuration::VALID_OPTIONS_KEYS.each do |key|
      it "should set #{key}" do
        Gitlab.configure do |config|
          config.send("#{key}=", key)
          Gitlab.send(key).should == key
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gitlab-2.2.0 spec/gitlab_spec.rb
gitlab-2.1.0 spec/gitlab_spec.rb
gitlab-2.0.0 spec/gitlab_spec.rb