-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
87 additions
and
5 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
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 @@ | ||
#<Bashly::ConfigurationError: [spec/fixtures/libraries/errors/files_array.yml] database.files must be an array> |
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 @@ | ||
#<Bashly::ConfigurationError: [spec/fixtures/libraries/errors/files_source.yml] database.files[0].source must be a string> |
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 @@ | ||
#<Bashly::ConfigurationError: [spec/fixtures/libraries/errors/files_target.yml] database.files[0].target must be a string> |
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 @@ | ||
#<Bashly::ConfigurationError: [spec/fixtures/libraries/errors/handler_string.yml] database.handler must be a string> |
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 @@ | ||
#<Bashly::ConfigurationError: [spec/fixtures/libraries/errors/help_string.yml] database.help must be a string> |
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 @@ | ||
#<Bashly::ConfigurationError: [spec/fixtures/libraries/errors/message_string.yml] database.post_install_message must be a string> |
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 @@ | ||
#<Bashly::ConfigurationError: spec/fixtures/libraries/errors/root_hash.yml must be a hash> |
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 @@ | ||
#<Bashly::ConfigurationError: [spec/fixtures/libraries/errors/usage_string.yml] database.usage must be a string> |
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
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,26 @@ | ||
describe LibrarySourceConfig do | ||
fixtures = Dir['spec/fixtures/libraries_errors/*.yml'] | ||
subject { described_class.new path } | ||
|
||
let(:path) { 'spec/fixtures/libraries/libraries.yml' } | ||
|
||
describe '#validated_data' do | ||
it 'returns the data after validating it' do | ||
expect(subject).to receive(:validate) | ||
expect(subject.validated_data).to eq subject.data | ||
end | ||
end | ||
|
||
describe '#validate' do | ||
fixtures.each do |path| | ||
fixture_name = File.basename path, '.yml' | ||
config = described_class.new path | ||
|
||
context "with #{fixture_name}.yml" do | ||
it 'raises an error' do | ||
expect { config.validate }.to raise_approval("libraries_validation/#{fixture_name}") | ||
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,4 @@ | ||
# error: files must be an array | ||
database: | ||
help: Help text | ||
files: one_file.txt |
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,6 @@ | ||
# error: files must have a source | ||
database: | ||
help: Help text | ||
files: | ||
- target: some_target | ||
|
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,6 @@ | ||
# error: files must have a target | ||
database: | ||
help: Help text | ||
files: | ||
- source: some_source | ||
|
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,7 @@ | ||
# error: handler must be a string (optional) | ||
database: | ||
help: Help text | ||
handler: 1 | ||
files: | ||
- source: "database/database.sh" | ||
target: "%{user_lib_dir}/database.%{user_ext}" |
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,6 @@ | ||
# error: help must be a string | ||
database: | ||
help: 1 | ||
files: | ||
- source: "database/database.sh" | ||
target: "%{user_lib_dir}/database.%{user_ext}" |
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,7 @@ | ||
# error: post_install_message must be a string (optional) | ||
database: | ||
help: Help text | ||
post_install_message: 1 | ||
files: | ||
- source: "database/database.sh" | ||
target: "%{user_lib_dir}/database.%{user_ext}" |
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,6 @@ | ||
# error: must be a hash | ||
- database: | ||
help: Add database utilities | ||
files: | ||
- source: "database/database.sh" | ||
target: "%{user_lib_dir}/database.%{user_ext}" |
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,7 @@ | ||
# error: usage must be a string (optional) | ||
database: | ||
help: Help text | ||
usage: 1 | ||
files: | ||
- source: "database/database.sh" | ||
target: "%{user_lib_dir}/database.%{user_ext}" |