Sha256: 31a349ed973db1a21150ff1e59df87c988835f815c51bf291fbc54bbaeee545b

Contents?: true

Size: 804 Bytes

Versions: 10

Compression:

Stored size: 804 Bytes

Contents

require "spec_helper"
require "boxes/testing/command"

RSpec.describe Boxes::Testing::Command do
  include described_class

  describe "#run_command" do
    context "with output" do
      it "returns the result of stdout" do
        run_command("echo 'Hello World!'")

        expect(response).to have_attributes(cmd: "echo 'Hello World!'",
                                            stdout: "Hello World!\n",
                                            exit_status: 0)
      end
    end

    context "with an exit status" do
      it "returns the custom exit code" do
        run_command("exit 1")

        expect(response).to have_attributes(cmd: "exit 1",
                                            stdout: "",
                                            exit_status: 1)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
boxes-3.7.0 spec/boxes/testing/command_spec.rb
boxes-3.6.1 spec/boxes/testing/command_spec.rb
boxes-3.6.0 spec/boxes/testing/command_spec.rb
boxes-3.5.0 spec/boxes/testing/command_spec.rb
boxes-3.4.0 spec/boxes/testing/command_spec.rb
boxes-3.3.1 spec/boxes/testing/command_spec.rb
boxes-3.3.0 spec/boxes/testing/command_spec.rb
boxes-3.2.0 spec/boxes/testing/command_spec.rb
boxes-3.1.0 spec/boxes/testing/command_spec.rb
boxes-3.0.0 spec/boxes/testing/command_spec.rb