Sha256: 9a18b61f9c3d0f448891e5d6b5f69ee91e72a7cf4ee9fa03c2c639cf0428dcbd

Contents?: true

Size: 1.79 KB

Versions: 2

Compression:

Stored size: 1.79 KB

Contents

require "rspec"
require "tmpdir"
require "fileutils"

require "jdt/manifest/manifest"
require "jdt/manifest/attributes"
require "jdt/manifest/bump"

describe Jdt::Manifest do

  FILE = "#{File.dirname(__FILE__)}/data/library.xml"

  it "should read manifest file with correct attributes" do

    manifest = Jdt::Manifest.new(FILE)

    manifest.required_joomla_version.should eq("1.7.0")
    manifest.ext_method.should eq("upgrade")
    manifest.ext_type.should eq("library")

    expect {
      manifest.ext_type_short
    }.to raise_error(NoMethodError)

    expect {
      manifest.prefixed_name
    }.to raise_error(NoMethodError)
    
    manifest.name.should eq("activerecord")
    manifest.description.should eq("desc text")

    manifest.version.should eq("1.0.0")
    manifest.creation_date.should eq("August 2011")
    manifest.homepage.should eq("https://www.github.com/simonharrer/activerecord")
    manifest.author.should eq("Simon Harrer")
    manifest.author_email.should eq("simon.harrer@feki.de")
    manifest.author_url.should eq("http://www.feki.de")

    manifest.license.should eq("licsence text")
    manifest.copyright.should eq("copyright text")

    manifest.folder.should eq(File.dirname(FILE))
  end

  it "should bump version correctly" do

    Dir.tmpdir do |dir|
      MANIFEST_FILE = "#{dir}/manifest.xml"
      File.cp(FILE, MANIFEST_FILE)

      manifest = Jdt::Manifest.new(FILE)

      manifest.version.should eq("1.0.0")
      manifest.bump!(:patch)
      manifest.version.should eq("1.0.1")

      manifest.bump!(:minor)
      manifest.version.should eq("1.1.0")

      manifest.bump!(:patch)
      manifest.version.should eq("1.1.1")

      manifest.bump!(:major)
      manifest.version.should eq("2.0.0")
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jdt-0.0.3 spec/jdt/manifest/manifest_spec.rb
jdt-0.0.2 spec/jdt/manifest/manifest_spec.rb