Sha256: b644c7473d3dcac9c7392cfab7e955ec8d42c491f7404d1709c66569404935bb

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

require File.dirname(__FILE__) + "/../lib/bump.rb"

describe Bump do

  around do |example|
    gemspec = <<-RUBY.sub(" "*6, "")
      Gem::Specification.new do |s|
        s.version = "1.0.0"
      end
    RUBY
    path = File.expand_path("../fixture/fixture.gemspec", __FILE__)
    File.open(path, 'w') {|f| f.write(gemspec) }
    example.call
    File.open(path, 'w') {|f| f.write("") }
  end

  it "should find current version" do
    bump = Bump::Bump.new("current")
    bump.gemspec_path = File.dirname(__FILE__) + "/fixture/fixture.gemspec"
    output = bump.run
    output.include?("1.0.0").should be_true
  end

  it "should bump a tiny version" do
    bump = Bump::Bump.new("tiny")
    bump.gemspec_path = File.dirname(__FILE__) + "/fixture/fixture.gemspec"
    output = bump.run
    output.include?("1.0.1").should be_true
  end
  
  it "should bump a minor version" do
    bump = Bump::Bump.new("minor")
    bump.gemspec_path = File.dirname(__FILE__) + "/fixture/fixture.gemspec"
    output = bump.run
    output.include?("1.1.0").should be_true
  end
  
  it "should bump a major version" do
    bump = Bump::Bump.new("major")
    bump.gemspec_path = File.dirname(__FILE__) + "/fixture/fixture.gemspec"
    output = bump.run
    output.include?("2.0.0").should be_true
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bump-0.1.4 spec/bump_spec.rb