-
-
Notifications
You must be signed in to change notification settings - Fork 540
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increase test coverage for Lotus::Config::Mapper
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
require 'test_helper' | ||
|
||
describe Lotus::Config::Mapper do | ||
describe '#to_proc' do | ||
describe 'when only path is given' do | ||
before do | ||
@mapping = Lotus::Config::Mapper.new(path) | ||
end | ||
|
||
describe "and it's nil" do | ||
let(:path) { nil } | ||
|
||
it 'raises error' do | ||
assert_raises ArgumentError do | ||
@mapping.to_proc | ||
end | ||
end | ||
end | ||
|
||
describe "and it points to an unknown file" do | ||
let(:path) { 'unknown/path' } | ||
|
||
it 'raises error' do | ||
assert_raises ArgumentError do | ||
@mapping.to_proc | ||
end | ||
end | ||
end | ||
|
||
describe "and it points to a valid file" do | ||
let(:path) { __dir__ + '/../fixtures/mapper' } | ||
|
||
it 'raises error' do | ||
assert_kind_of Proc, @mapping.to_proc | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
puts 'hi' |