Skip to content

Commit

Permalink
style(build_namespace_name): fix Rubocop issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Olha-30 committed Jun 13, 2023
1 parent dbf79fd commit 73e10db
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def call
# @return [Symbol]
#
def namespace_name
Commands::BuildNamespaceName.call(scope: scope, prepend: prepend)
@namespace_name ||= Commands::BuildNamespaceName.call(scope: scope, prepend: prepend)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def call
# @return [Symbol]
#
def namespace_name
Commands::BuildNamespaceName.call(scope: scope, prepend: prepend)
@namespace_name ||= Commands::BuildNamespaceName.call(scope: scope, prepend: prepend)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

require "convenient_service"

# rubocop:disable RSpec/NestedGroups
RSpec.describe ConvenientService::Support::DependencyContainer::Commands::BuildNamespaceName do
example_group "class methods" do
describe ".call" do
Expand All @@ -16,15 +17,15 @@
context "when `scope` is valid" do
context "when `scope` is `:class`" do
it "returns valid namespace name" do
expect(command_result).to eq(:"ImportedIncludedClassMethods")
expect(command_result).to eq(:ImportedIncludedClassMethods)
end
end

context "when `scope` is `:instance`" do
let(:scope) { :instance }

it "returns valid namespace name" do
expect(command_result).to eq(:"ImportedIncludedInstanceMethods")
expect(command_result).to eq(:ImportedIncludedInstanceMethods)
end
end
end
Expand All @@ -33,7 +34,7 @@
let(:scope) { nil }

it "returns namespace name without `scope` value" do
expect(command_result).to eq(:"ImportedIncludedMethods")
expect(command_result).to eq(:ImportedIncludedMethods)
end
end
end
Expand All @@ -42,15 +43,15 @@
context "when `prepend` is valid" do
context "when `prepend` is `false`" do
it "returns valid namespace name" do
expect(command_result).to eq(:"ImportedIncludedClassMethods")
expect(command_result).to eq(:ImportedIncludedClassMethods)
end
end

context "when `prepend` is `true`" do
let(:prepend) { true }

it "returns valid namespace name" do
expect(command_result).to eq(:"ImportedPrependedClassMethods")
expect(command_result).to eq(:ImportedPrependedClassMethods)
end
end
end
Expand All @@ -59,10 +60,11 @@
let(:prepend) { nil }

it "behaves like `include`" do
expect(command_result).to eq(:"ImportedIncludedClassMethods")
expect(command_result).to eq(:ImportedIncludedClassMethods)
end
end
end
end
end
end
# rubocop:enable RSpec/NestedGroups
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

require "convenient_service"

# rubocop:disable RSpec/NestedGroups
RSpec.describe ConvenientService::Support::DependencyContainer::Commands::FetchNamespace do
example_group "class methods" do
describe ".call" do
Expand Down Expand Up @@ -54,3 +55,4 @@
end
end
end
# rubocop:enable RSpec/NestedGroups
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

require "convenient_service"

# rubocop:disable RSpec/NestedGroups
RSpec.describe ConvenientService::Support::DependencyContainer::Commands::GetNamespace do
example_group "class methods" do
describe ".call" do
Expand Down Expand Up @@ -50,3 +51,4 @@
end
end
end
# rubocop:enable RSpec/NestedGroups

0 comments on commit 73e10db

Please sign in to comment.