Sha256: 8300ac13eff89988e7c3d96db87383ca78be055b9c16d13552448a29be3d5012

Contents?: true

Size: 1.71 KB

Versions: 29

Compression:

Stored size: 1.71 KB

Contents

require 'spec_helper'

describe Open do

  let(:command) { Open.new }
  before do
    command.stub(:current_branch).and_return('test-br')
  end
  subject { command }

  its(:cmd) { should match /open #{command.page_url}/ }

  it "should have the right page URLs" do
    urls = %w[
https://mwatson@bitbucket.org/atlassian/amps.git https://bitbucket.org/atlassian/amps
git@bitbucket.org:atlassian/amps.git https://bitbucket.org/atlassian/amps
git@github.com:mhartl/git-utils.git https://github.com/mhartl/git-utils
https://github.com/mhartl/git-utils.git https://github.com/mhartl/git-utils
ssh://git@stash.atlassian.com:7999/stash/stash.git https://stash.atlassian.com/projects/stash/repos/stash/browse?at=test-br
https://mwatson@stash.atlassian.com:7990/scm/stash/stash.git https://stash.atlassian.com:7990/projects/stash/repos/stash/browse?at=test-br
ssh://git@stash.atlassian.com/stash/stash.git https://stash.atlassian.com/projects/stash/repos/stash/browse?at=test-br
https://mwatson@stash.atlassian.com/scm/stash/stash.git https://stash.atlassian.com/projects/stash/repos/stash/browse?at=test-br
https://mwatson@stash.atlassian.com/stash/scm/stash/stash.git https://stash.atlassian.com/stash/projects/stash/repos/stash/browse?at=test-br
https://mwatson@stash.atlassian.com:7990/stash/scm/stash/stash.git https://stash.atlassian.com:7990/stash/projects/stash/repos/stash/browse?at=test-br
https://example.com/repos/foobar.git https://example.com/repos/foobar
    ]
    urls.each_slice(2) do |origin_url, page_url|
      command.stub(:origin_url).and_return(origin_url)
      expect(command.page_url).to include page_url
    end
  end

  describe "command-line command" do
    subject { `bin/git-open --debug` }
    it { should match /open/ }
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
git-utils-2.4.0 spec/commands/open_spec.rb
git-utils-2.3.0 spec/commands/open_spec.rb
git-utils-2.2.1 spec/commands/open_spec.rb
git-utils-2.2.0 spec/commands/open_spec.rb
git-utils-2.1.0 spec/commands/open_spec.rb
git-utils-2.0.0 spec/commands/open_spec.rb
git-utils-1.0.0 spec/commands/open_spec.rb
git-utils-0.7.1 spec/commands/open_spec.rb
git-utils-0.7.0 spec/commands/open_spec.rb
git-utils-0.6.5 spec/commands/open_spec.rb
git-utils-0.6.4 spec/commands/open_spec.rb
git-utils-0.6.3 spec/commands/open_spec.rb
git-utils-0.6.2 spec/commands/open_spec.rb
git-utils-0.6.1 spec/commands/open_spec.rb
git-utils-0.6.0 spec/commands/open_spec.rb
git-utils-0.5.10 spec/commands/open_spec.rb
git-utils-0.5.9 spec/commands/open_spec.rb
git-utils-0.5.8 spec/commands/open_spec.rb
git-utils-0.5.7 spec/commands/open_spec.rb
git-utils-0.5.6 spec/commands/open_spec.rb