Sha256: 78599f61023b42b6312763802aa49e46f57a050225a4d5de806d484b2c0edc1a

Contents?: true

Size: 1006 Bytes

Versions: 1

Compression:

Stored size: 1006 Bytes

Contents

require 'spec_helper'
require 'bukin'
require 'bukin/installer'
require 'bukin/exceptions'

describe Bukin::Installer do
  describe :get_match do
    before :all do
      @installer = Bukin::Installer.new(nil)
    end

    it 'directly returns a regex' do
      @installer.get_match(/something/).should == /something/
    end

    it 'wraps a string with start and end anchors' do
      @installer.get_match('something').should == /^something$/
    end

    it 'matches anything for :all' do
      @installer.get_match(:all).should == //
    end

    it 'matches .jar files by default' do
      @installer.get_match(nil).should == /\.jar$/
    end

    it 'errors when given anything else' do
      expect do
        @installer.get_match({})
      end.to raise_error(Bukin::InstallError)

      expect do
        @installer.get_match([])
      end.to raise_error(Bukin::InstallError)

      expect do
        @installer.get_match(Object.new)
      end.to raise_error(Bukin::InstallError)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bukin-0.6.0 spec/installer_spec.rb