Skip to content

Commit

Permalink
Stub bundle install in install spec
Browse files Browse the repository at this point in the history
  • Loading branch information
timriley committed Nov 13, 2024
1 parent 23b9c4e commit f9dbbf7
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions spec/unit/hanami/cli/commands/app/install_spec.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# frozen_string_literal: true

RSpec.describe Hanami::CLI::Commands::App::Install do
subject { described_class.new(out: stdout) }
let(:stdout) { StringIO.new }
subject { described_class.new(fs: fs, bundler: bundler, out: out) }

let(:fs) { Hanami::CLI::Files.new(memory: true, out: out) }
let(:bundler) { Hanami::CLI::Bundler.new(fs: fs) }
let(:out) { StringIO.new }

describe "#call" do
it "installs third-party plugins" do
expect(bundler).to receive(:install!)
.exactly(1).time
.and_return(true)

subject.call

stdout.rewind
expect(stdout.read.chomp).to eq("")
out.rewind
expect(out.read.chomp).to eq("")
end
end
end

0 comments on commit f9dbbf7

Please sign in to comment.