Skip to content

Commit 7f6faea

Browse files
committed
remove singular spec for old approach
1 parent 87591d1 commit 7f6faea

File tree

3 files changed

+1
-35
lines changed

3 files changed

+1
-35
lines changed

lib/hanami/cli/commands/app/generate/command.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
require "shellwords"
66
require_relative "../../../naming"
77
require_relative "../../../errors"
8-
require "pry"
98

109
module Hanami
1110
module CLI

spec/unit/hanami/cli/commands/app/command_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# frozen_string_literal: true
22

3-
require "pry"
4-
53
RSpec.describe Hanami::CLI::Commands::App::Command, :app do
64
context "#call" do
75
subject { cmd.new }

spec/unit/hanami/cli/commands/app/generate/action_spec.rb

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
let(:out) { StringIO.new }
1010
let(:fs) { Hanami::CLI::Files.new(memory: true, out: out) }
1111
let(:inflector) { Dry::Inflector.new }
12-
`let(:app) { Hanami.app.namespace }`
12+
let(:app) { Hanami.app.namespace }
1313
let(:dir) { inflector.underscore(app) }
1414
let(:controller) { "users" }
1515
let(:action) { "index" }
@@ -1345,37 +1345,6 @@ def handle(request, response)
13451345
end
13461346
end
13471347
end
1348-
1349-
context "when run from within a slice directory" do
1350-
let(:slice) { "books" }
1351-
let(:controller) { "users" }
1352-
let(:action) { "index" }
1353-
let(:action_name) { "#{controller}.#{action}" }
1354-
1355-
it "creates the action for the current slice" do
1356-
within_application_directory do
1357-
prepare_slice!
1358-
1359-
# That is a lot of mocks, is there a better way for this?
1360-
mock_app = double("Hanami::App")
1361-
allow(mock_app).to receive(:root).and_return(Pathname.new(Dir.pwd))
1362-
allow(mock_app).to receive(:slices).and_return({slice.to_sym => double("Slice")})
1363-
allow(mock_app).to receive(:namespace).and_return(app)
1364-
allow(mock_app).to receive(:inflector).and_return(inflector)
1365-
1366-
allow(subject).to receive(:app).and_return(mock_app)
1367-
1368-
slice_path = File.join(Dir.pwd, "slices", slice)
1369-
allow(Dir).to receive(:pwd).and_return(slice_path)
1370-
1371-
subject.call(name: action_name)
1372-
1373-
expect(fs.exist?("slices/#{slice}/actions/#{controller}/#{action}.rb")).to be(true)
1374-
expect(fs.read("config/routes.rb")).to include("slice :#{slice}")
1375-
expect(fs.read("slices/#{slice}/actions/#{controller}/#{action}.rb")).to include("module #{inflector.camelize(slice)}")
1376-
end
1377-
end
1378-
end
13791348
end
13801349

13811350
private

0 commit comments

Comments
 (0)