Sha256: 005393652eff2f0759f38f1f6b08accaa1ee87d29886d58354f2e47f33515355

Contents?: true

Size: 1.34 KB

Versions: 2

Compression:

Stored size: 1.34 KB

Contents

require 'spec_helper'

describe KrakenBuild do
  context "Setting config" do
    let(:options) { mock(Hash).as_null_object }

    it "sets the config options at @config" do
      kraken = KrakenBuild.set_config(options)
      KrakenBuild.instance_variable_get(:@config).should eq(options)
    end

    it "sets the repository option as @repository" do
      repository = mock(String)
      options.should_receive(:[]).with(:repository).and_return(repository)
      kraken = KrakenBuild.set_config(options)
      KrakenBuild.instance_variable_get(:@repository).should eq(repository)
    end

    it "sets the github api from instance call" do
      github_api = mock(GithubApi).as_null_object
      GithubApi.should_receive(:new).and_return(github_api)
      kraken = KrakenBuild.set_config(options)
      KrakenBuild.instance_variable_get(:@github).should eq(github_api)
    end
    it "sets the jenkins api from instance call" do
      jenkins_api = mock(GithubApi).as_null_object
      JenkinsApi.should_receive(:new).and_return(jenkins_api)
      kraken = KrakenBuild.set_config(options)
      KrakenBuild.instance_variable_get(:@jenkins).should eq(jenkins_api)
    end
    it "returns the config" do
      kraken = KrakenBuild.set_config(options)
      KrakenBuild.instance_variable_get(:@config).should eq(options)
      kraken.should eq(options)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kraken-build-0.0.5 spec/lib/kraken-build_spec.rb
kraken-build-0.0.4 spec/lib/kraken-build_spec.rb