Sha256: 86d90b14b206a22b6525c83b6cf089e5443f6072f35aebbb6a9cc2dcccaee0b8

Contents?: true

Size: 941 Bytes

Versions: 3

Compression:

Stored size: 941 Bytes

Contents

require_relative "../spec_helper.rb"

include GivenFilesystemSpecHelpers

describe YSI::Version do
  it "has default path" do
    config = <<EOT
assertions:
  version:
EOT
    engine = YSI::Engine.new
    engine.read_config(config)

    expect(engine.assertions.first.version_file).to eq("lib/version.rb")
  end

  it "reads path parameter" do
    config = <<EOT
assertions:
  version:
    version_file: version.go
EOT
    engine = YSI::Engine.new
    engine.read_config(config)

    expect(engine.assertions.first.version_file).to eq("version.go")
  end

  describe "parses version" do
    use_given_filesystem

    let(:subject) { YSI::Version.new(YSI::Engine.new) }

    it "in ruby" do
      file = given_file("version/version.rb")
      expect(subject.parse_version(file)).to eq("0.0.2")
    end

    it "in go" do
      file = given_file("version/version.go")
      expect(subject.parse_version(file)).to eq("0.0.1")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
yes_ship_it-0.0.5 spec/unit/assertions/version_spec.rb
yes_ship_it-0.0.4 spec/unit/assertions/version_spec.rb
yes_ship_it-0.0.3 spec/unit/assertions/version_spec.rb