-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstaller_spec.rb
41 lines (33 loc) · 979 Bytes
/
installer_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
require 'spec_helper'
require 'bukin'
require 'bukin/installer'
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