Sha256: c1fcb252f83d9cb0b7f6ddf561927e669ffa8ee85cd6d909c21bd6b0853dd8d9

Contents?: true

Size: 787 Bytes

Versions: 9

Compression:

Stored size: 787 Bytes

Contents

require_relative "../spec_helper.rb"

describe YSI::ReleaseBranch do
  describe "#current_branch" do
    it "finds current non-master branch" do
      a = YSI::ReleaseBranch.new(YSI::Engine)

      allow(a).to receive(:git_branch).and_return("  master\n* otherone\n")

      expect(a.current_branch).to eq("otherone")
    end

    it "finds current master branch" do
      a = YSI::ReleaseBranch.new(YSI::Engine)

      allow(a).to receive(:git_branch).and_return("* master\n otherone\n")

      expect(a.current_branch).to eq("master")
    end

    it "finds current master branch if it's the only branch" do
      a = YSI::ReleaseBranch.new(YSI::Engine)

      allow(a).to receive(:git_branch).and_return("* master\n")

      expect(a.current_branch).to eq("master")
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
yes_ship_it-0.2.1 spec/unit/assertions/release_branch_spec.rb
yes_ship_it-0.2.0 spec/unit/assertions/release_branch_spec.rb
yes_ship_it-0.1.2 spec/unit/assertions/release_branch_spec.rb
yes_ship_it-0.1.1 spec/unit/assertions/release_branch_spec.rb
yes_ship_it-0.1.0 spec/unit/assertions/release_branch_spec.rb
yes_ship_it-0.0.6 spec/unit/assertions/release_branch_spec.rb
yes_ship_it-0.0.5 spec/unit/assertions/release_branch_spec.rb
yes_ship_it-0.0.4 spec/unit/assertions/release_branch_spec.rb
yes_ship_it-0.0.3 spec/unit/assertions/release_branch_spec.rb