Sha256: 29c0b023018e8c5bbd2d1395ae9144fc652e7a3f15cdd375343a66f44bcb7a7a

Contents?: true

Size: 1.94 KB

Versions: 6

Compression:

Stored size: 1.94 KB

Contents

require 'spec_helper'

describe Bueller do
  let(:bueller_with_git) { Bueller.new(git_dir_path) }
  let(:bueller_without_git) { Bueller.new(non_git_dir_path) }
  let(:bueller) { Bueller.new(git_dir_path) }
  let(:git_dir_path) { File.join(FileSystem.tmp_dir, 'git') }
  let(:non_git_dir_path) { File.join(FileSystem.tmp_dir, 'nongit') }

  describe '#in_git_repo?' do
    it 'should return true if it is in a git repo' do
      FileUtils.mkdir_p git_dir_path
      Dir.chdir git_dir_path do
        Git.init
      end
      bueller_with_git.should be_in_git_repo
    end
    it 'should return false if it is not in a git repo' do
      FileUtils.mkdir_p non_git_dir_path
      bueller_without_git.should_not be_in_git_repo
    end
  end

  describe '#git_base_dir' do
    it 'should find the base repo' do
      bueller = Bueller.new(File.dirname(File.expand_path(__FILE__)))
      bueller.git_base_dir.should == File.dirname(File.dirname(File.expand_path(__FILE__)))
    end
  end

  describe '#write_gemspec' do
    it 'should build and run write gemspec command when writing gemspec' do
      Bueller::Commands::WriteGemspec.should_receive(:run_for).with(bueller)

      bueller.write_gemspec
    end
  end

  describe '#bump_major_version' do
    it 'should build and run bump major version command when bumping major version' do
      Bueller::Commands::Version::BumpMajor.should_receive(:run_for).with(bueller)

      bueller.bump_major_version
    end
  end

  describe '#bump_major_version' do
    it 'should build and run bump minor version command when bumping minor version' do
      Bueller::Commands::Version::BumpMinor.should_receive(:run_for).with(bueller)

      bueller.bump_minor_version
    end
  end

  describe '#bump_major_version' do
    it 'should build and run write version command when writing version' do
      Bueller::Commands::Version::Write.should_receive(:run_for).with(bueller, 1, 5, 2, 'a1')

      bueller.write_version(1, 5, 2, 'a1')
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bueller-0.0.9 spec/bueller_spec.rb
bueller-0.0.8 spec/bueller_spec.rb
bueller-0.0.7 spec/bueller_spec.rb
bueller-0.0.6 spec/bueller_spec.rb
bueller-0.0.5 spec/bueller_spec.rb
bueller-0.0.4 spec/bueller_spec.rb