-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from james-stocks/unit_test_baseline
Unit test baseline
- Loading branch information
Showing
13 changed files
with
102 additions
and
1 deletion.
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,7 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Running `pdk bundle`' do | ||
subject(:test_cmd) { PDK::CLI.instance_variable_get(:@bundle_cmd) } | ||
|
||
it { is_expected.not_to be_nil } | ||
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,10 @@ | ||
require 'spec_helper' | ||
|
||
describe 'PDK FatalError' do | ||
subject(:fatal_error) { PDK::CLI::FatalError } | ||
|
||
it 'has a message' do | ||
error = fatal_error.new | ||
expect(error.message).not_to be_nil | ||
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,7 @@ | ||
require 'spec_helper' | ||
|
||
describe 'PDK::CLI::Exec' do | ||
subject(:exec) { PDK::CLI::Exec } | ||
|
||
it { is_expected.not_to be_nil } | ||
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,7 @@ | ||
require 'spec_helper' | ||
|
||
describe 'PDK test unit' do | ||
subject(:test_unit_cmd) { PDK::CLI.instance_variable_get(:@test_unit_cmd) } | ||
|
||
it { is_expected.not_to be_nil } | ||
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,9 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Module interview' do | ||
subject(:interview) { PDK::CLI::Util::Interview } | ||
|
||
it 'initially has 0 questions' do | ||
expect(interview.new({}, {}).num_questions).to eq(0) | ||
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,12 @@ | ||
require 'spec_helper' | ||
require 'pdk/cli/util' | ||
|
||
describe 'PDK::CLI::Util' do | ||
context 'ensure_in_module! method' do | ||
subject(:ensure_in_module) { PDK::CLI::Util.ensure_in_module! } | ||
|
||
it 'raises an error when not in a module directory' do | ||
expect { ensure_in_module }.to raise_error(PDK::CLI::FatalError) | ||
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,7 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Running `pdk validate`' do | ||
subject(:validate_cmd) { PDK::CLI.instance_variable_get(:@validate_cmd) } | ||
|
||
it { is_expected.not_to be_nil } | ||
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,7 @@ | ||
require 'spec_helper' | ||
|
||
describe PDK::Module::TemplateDir do | ||
it 'has a metadata method' do | ||
expect(described_class.instance_methods(false)).to include(:metadata) | ||
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,8 @@ | ||
require 'spec_helper' | ||
require 'pdk/tests/unit' | ||
|
||
describe PDK::Test::Unit do | ||
it 'has an invoke method' do | ||
expect(described_class.methods(false)).to include(:invoke) | ||
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,9 @@ | ||
require 'spec_helper' | ||
|
||
describe PDK::Util::Version do | ||
context 'Getting the version_string' do | ||
subject(:version_string) { described_class.version_string } | ||
|
||
it { is_expected.not_to be_nil } | ||
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,11 @@ | ||
require 'spec_helper' | ||
|
||
describe PDK::Validate::BaseValidator do | ||
context 'a class inheriting from BaseValidator' do | ||
subject(:validator) { Class.new(described_class) } | ||
|
||
it 'has an invoke method' do | ||
expect(validator.methods).to include(:invoke) | ||
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,7 @@ | ||
require 'spec_helper' | ||
|
||
describe 'PDK version string' do | ||
it 'has major minor and patch numbers' do | ||
expect(PDK::VERSION).to match(%r{^[0-9]+\.[0-9]+\.[0-9]+}) | ||
end | ||
end |