Sha256: 9a66f65730d9b78a4b54007cc0149c2819562d69bf3e45aefb3e9943dad63b99

Contents?: true

Size: 1.93 KB

Versions: 2

Compression:

Stored size: 1.93 KB

Contents

require 'spec_helper'

describe Cany::Specification do
  describe '#new' do
    it 'should have a name' do
      spec = Cany::Specification.new do
        name 'example'
      end
      expect(spec.name).to eq 'example'
    end

    it 'should have a description' do
      spec = Cany::Specification.new do
        description 'Test hans otto project'
      end
      expect(spec.description).to eq 'Test hans otto project'
    end

    it 'should have a maintainer name' do
      spec = Cany::Specification.new do
        maintainer_name 'Otto Hans'
      end
      expect(spec.maintainer_name).to eq 'Otto Hans'
    end

    it 'should have a maintainer email' do
      spec = Cany::Specification.new do
        maintainer_email 'hans.otto@example.org'
      end
      expect(spec.maintainer_email).to eq 'hans.otto@example.org'
    end

    it 'should have a website' do
      spec = Cany::Specification.new do
        website 'http://example.org/~hans.otto/'
      end
      expect(spec.website).to eq 'http://example.org/~hans.otto/'
    end

    it 'should have a licence' do
      spec = Cany::Specification.new do
        licence 'MIT'
      end
      expect(spec.licence).to eq 'MIT'
    end

    it 'should have a version' do
      spec = Cany::Specification.new do
        version '0.1'
      end
      expect(spec.version).to eq '0.1'
    end

    it 'should be able to include recipes' do
      spec = Cany::Specification.new do
        use :bundler
      end
      expect(spec.recipes).to eq [:bundler]
    end

    it 'should accept a block for own build steps' do
      spec = Cany::Specification.new do
        build do
          install 'hans', 'otto'
        end
      end
      expect(spec.build).to be_a_kind_of Proc
    end

    it 'should accept a block for own build steps' do
      spec = Cany::Specification.new do
        binary do
          install 'hans', 'otto'
        end
      end
      expect(spec.binary).to be_a_kind_of Proc
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cany-0.0.2 spec/cany/specification_spec.rb
cany-0.0.1 spec/cany/specification_spec.rb