-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add specs for ruby bundle resolution
- Loading branch information
Showing
20 changed files
with
248 additions
and
36 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,8 @@ | ||
require: | ||
- rubocop-powerhome | ||
|
||
Rails: | ||
Enabled: false | ||
|
||
Gemspec/RequireMFA: | ||
Enabled: false |
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
require "bundler/gem_tasks" | ||
require "rubocop/rake_task" | ||
require "rspec/core/rake_task" | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
RuboCop::RakeTask.new(:rubocop) | ||
|
||
require "standard/rake" | ||
|
||
task default: %i[spec standard] | ||
task default: %i[spec rubocop] |
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,9 @@ | ||
--- | ||
- - :inherit_from | ||
- https://raw.githubusercontent.com/powerhome/oss-guide/master/license_rules.yml | ||
- - :approve | ||
- bundler | ||
- :who: Carlos Palhares <carlos.palhares@powerhrg.com> | ||
:why: 'Bundler <https://rubygems.org/gems/bundler/versions/1.17.3> is licensed under MIT, but license_finder sometimes fails to resolve that with 1.17.3.' | ||
:versions: [1.17.3] | ||
:when: 2022-11-02 20:36:55.617698000 Z |
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
32 changes: 32 additions & 0 deletions
32
cobra_commander-ruby/spec/cobra_commander/ruby/bundle_spec.rb
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,32 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.describe CobraCommander::Ruby::Bundle do | ||
subject { CobraCommander::Ruby::Bundle.new(dummy_path) } | ||
let(:hr_package) do | ||
subject.packages.find do |package| | ||
package.name.eql?("hr") | ||
end | ||
end | ||
|
||
it "can load all the internal packages" do | ||
expect(subject.packages.map(&:name)).to match_array %w[ | ||
authn | ||
authz | ||
finance | ||
hr | ||
sales | ||
] | ||
end | ||
|
||
it "does not include external packages" do | ||
expect(subject.packages.map(&:name)).to_not include "httparty" | ||
end | ||
|
||
it "loads the internal dependencies of loaded packages" do | ||
expect(hr_package.dependencies).to match_array %w[authz authn finance] | ||
end | ||
|
||
it "package paths are the root path of a package" do | ||
expect(hr_package.path).to eql "#{dummy_path}/components/hr/hr.gemspec" | ||
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
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 @@ | ||
# frozen_string_literal: true | ||
|
||
path "components" do | ||
gem "authn" | ||
gem "authz" | ||
gem "finance" | ||
gem "hr" | ||
gem "sales" | ||
end | ||
|
||
gem "httparty" |
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,33 @@ | ||
PATH | ||
remote: components | ||
specs: | ||
authn (0.1.0) | ||
authz (0.1.0) | ||
authn | ||
finance (0.1.0) | ||
authn | ||
authz | ||
hr (0.1.0) | ||
authn | ||
authz | ||
finance | ||
sales (0.1.0) | ||
authn | ||
authz | ||
hr | ||
|
||
GEM | ||
specs: | ||
|
||
PLATFORMS | ||
arm64-darwin-22 | ||
|
||
DEPENDENCIES | ||
authn! | ||
authz! | ||
finance! | ||
hr! | ||
sales! | ||
|
||
BUNDLED WITH | ||
2.3.24 |
8 changes: 8 additions & 0 deletions
8
cobra_commander-ruby/spec/dummy/components/authn/authn.gemspec
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 @@ | ||
# frozen_string_literal: true | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "authn" | ||
spec.version = "0.1.0" | ||
spec.summary = "This is an example component for cobra_commander-ruby" | ||
spec.authors = ["Carlos Palhares"] | ||
end |
10 changes: 10 additions & 0 deletions
10
cobra_commander-ruby/spec/dummy/components/authz/authz.gemspec
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 @@ | ||
# frozen_string_literal: true | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "authz" | ||
spec.version = "0.1.0" | ||
spec.summary = "This is an example component for cobra_commander-ruby" | ||
spec.authors = ["Carlos Palhares"] | ||
|
||
spec.add_dependency "authn" | ||
end |
11 changes: 11 additions & 0 deletions
11
cobra_commander-ruby/spec/dummy/components/finance/authz.gemspec
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 @@ | ||
# frozen_string_literal: true | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "finance" | ||
spec.version = "0.1.0" | ||
spec.summary = "This is an example component for cobra_commander-ruby" | ||
spec.authors = ["Carlos Palhares"] | ||
|
||
spec.add_dependency "authn" | ||
spec.add_dependency "authz" | ||
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,16 @@ | ||
# frozen_string_literal: true | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "hr" | ||
spec.version = "0.1.0" | ||
spec.summary = "This is an example component for cobra_commander-ruby" | ||
spec.authors = ["Carlos Palhares"] | ||
|
||
# External dependencies | ||
spec.add_dependency "lockbox" | ||
|
||
# Internal dependencies | ||
spec.add_dependency "authn" | ||
spec.add_dependency "authz" | ||
spec.add_dependency "finance" | ||
end |
12 changes: 12 additions & 0 deletions
12
cobra_commander-ruby/spec/dummy/components/sales/sales.gemspec
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 @@ | ||
# frozen_string_literal: true | ||
|
||
Gem::Specification.new do |spec| | ||
spec.name = "sales" | ||
spec.version = "0.1.0" | ||
spec.summary = "This is an example component for cobra_commander-ruby" | ||
spec.authors = ["Carlos Palhares"] | ||
|
||
spec.add_dependency "authn" | ||
spec.add_dependency "authz" | ||
spec.add_dependency "hr" | ||
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 @@ | ||
# frozen_string_literal: true | ||
|
||
module DummyHelper | ||
def dummy_path | ||
File.join(__dir__, "dummy") | ||
end | ||
end |
Oops, something went wrong.