Sha256: bb9e0f417030d9a2a8d88c3ae981e1bbb54567824c6f7e37dc64e2dbef117100

Contents?: true

Size: 1.15 KB

Versions: 9

Compression:

Stored size: 1.15 KB

Contents

require 'spec_helper'

describe "Module file format" do
  before :each do
    VersionInfo.file_format = :module

    @test_module = Module.new
    @test_module.send :include, VersionInfo # force new VERSION value
    @test_module::VERSION.file_name = nil
  end

  it "has accessor " do
    @test_module.should respond_to("VERSION")
  end

  it "has mutator " do
    @test_module.should respond_to("VERSION=")
  end

  it "has default filename" do
    @test_module.VERSION.file_name.should ==  Dir.pwd + '/' + 'version.rb'
  end

  it "is initalized" do
    @test_module.VERSION.to_hash.should == {:major => 0, :minor => 0, :patch => 0 }
  end

  it "has segmentes" do
    @test_module.VERSION.major.should == 0
    @test_module.VERSION.minor.should == 0
    @test_module.VERSION.patch.should == 0
  end

  it "can assign VERSION" do
    @test_module.VERSION = '1.2.4'
    @test_module.VERSION.author = 'jcangas'    
    @test_module.VERSION.email = 'jorge.cangas@gmail.com'    
    @test_module.VERSION.class.name.should == 'VersionInfo::Data'
    @test_module.VERSION.to_hash.should == {major: 1, minor: 2, patch: 4, author: 'jcangas', email: 'jorge.cangas@gmail.com' }
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
version_info-1.8.0 spec/version_info/module_format_spec.rb
version_info-1.7.7 spec/version_info/module_format_spec.rb
version_info-1.7.6 spec/version_info/module_format_spec.rb
version_info-1.7.5 spec/version_info/module_format_spec.rb
version_info-1.7.4 spec/version_info/module_format_spec.rb
version_info-1.7.3 spec/version_info/module_format_spec.rb
version_info-1.7.2 spec/version_info/module_format_spec.rb
version_info-1.7.1 spec/version_info/module_format_spec.rb
version_info-1.7.0 spec/version_info/module_format_spec.rb