Sha256: b589d3f098a70e5fc9843026995d92d5df9d15daecdf074ceb4d83f68831f023

Contents?: true

Size: 1.33 KB

Versions: 20

Compression:

Stored size: 1.33 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe GitIssue do
  describe '#main' do
    context 'config issue.type does not configured' do
      it{
        GitIssue::Helper.should_receive(:configured_value).with("type").and_return("")
        GitIssue::Helper.should_receive(:configured_value).with("apikey").and_return("some value")
        GitIssue::Helper.should_receive(:configure_error).with( "type (redmine | github)",  "git config issue.type redmine")
        lambda { GitIssue.main([]) }.should raise_error(SystemExit)
      }
    end

    context 'invalid issue.type' do
      it{
        GitIssue::Helper.should_receive(:configured_value).with("type").and_return("unknown-type")
        GitIssue::Helper.should_receive(:configured_value).with("apikey").and_return("some value")
        lambda { GitIssue.main([]) }.should raise_error(SystemExit)
      }
    end
  end

  describe '#its_klass_of' do
    context 'unknown type' do
      specify { lambda { GitIssue::Helper.its_klass_of("unknown_type") }.should raise_error }
    end

    context 'type is redmine' do
      subject { GitIssue::Helper.its_klass_of("redmine") }
      it { should == GitIssue::Redmine }
    end

    context 'type is github' do
      subject { GitIssue::Helper.its_klass_of("github") }
      it { should == GitIssue::Github}
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
git-issue-0.9.2 spec/git_issue_spec.rb
git-issue-0.9.1 spec/git_issue_spec.rb
git-issue-0.9.0 spec/git_issue_spec.rb
git-issue-0.8.7 spec/git_issue_spec.rb
git-issue-0.8.6 spec/git_issue_spec.rb
git-issue-0.8.5 spec/git_issue_spec.rb
git-issue-0.8.4 spec/git_issue_spec.rb
git-issue-0.8.3 spec/git_issue_spec.rb
git-issue-0.8.2 spec/git_issue_spec.rb
git-issue-0.8.1 spec/git_issue_spec.rb
git-issue-0.8.0 spec/git_issue_spec.rb
git-issue-0.7.8 spec/git_issue_spec.rb
git-issue-0.7.7 spec/git_issue_spec.rb
git-issue-0.7.6 spec/git_issue_spec.rb
git-issue-0.7.5 spec/git_issue_spec.rb
git-issue-0.7.4 spec/git_issue_spec.rb
git-issue-0.7.3 spec/git_issue_spec.rb
git-issue-0.7.2 spec/git_issue_spec.rb
git-issue-0.7.1 spec/git_issue_spec.rb
git-issue-0.7.0 spec/git_issue_spec.rb