Sha256: a30f60536dc69f1b3b55e37f5b2c0fd9a924fe59e51470f6941eb39e0512fbad

Contents?: true

Size: 1.15 KB

Versions: 4

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'


describe GitTopic do

  describe "#comments" do

    describe "on a branch with no comments" do

      before( :each ) do
        use_repo            'in-progress'
        GitTopic.work_on    'pirates-advanced'
      end
      after( :each )  { Dir.chdir '..' }

      it "should report that there are no comments" do
        lambda{ GitTopic.comments }.should_not      raise_error
        @output.should_not                          be_nil
        @output.should                              =~ /no comments/i
      end
    end


    describe "on a branch with comments" do

      before( :each ) do
        use_repo            'in-progress'
        GitTopic.work_on    'krakens'
      end

      after( :each )  { Dir.chdir '..' }

      it "should invoke git log to display the comments" do
        GitTopic.should_receive( :git ) do |cmd|
          cmd.should =~ /log/
          cmd.should =~ %r{origin/master\.\.}
          cmd.should =~ /--no-standard-notes/
          cmd.should =~ %r{--show-notes=refs/notes/reviews/#{@user}/krakens}
        end

        lambda{ GitTopic.comments }.should_not      raise_error
      end
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
git-topic-0.2.3.1 spec/git_topic_comments_spec.rb
git-topic-0.2.3 spec/git_topic_comments_spec.rb
git-topic-0.2.2 spec/git_topic_comments_spec.rb
git-topic-0.2.1 spec/git_topic_comments_spec.rb