main
 1# frozen_string_literal: true
 2
 3require 'English'
 4
 5RSpec.shared_context 'when executing the cli' do
 6  subject { execute(command) }
 7
 8  let(:status) { subject[0] }
 9  let(:output) { subject[1] }
10  let(:env) {}
11
12  def execute(command, mute: false, env: self.env)
13    full_command = "#{env} ./exe/saml-kit #{command} 2>&1"
14    puts full_command unless mute
15    output = `#{full_command}`
16    [$CHILD_STATUS, output]
17  end
18end
19
20RSpec.configure do |config|
21  config.include_context 'when executing the cli'
22end