Sha256: 3b5fe7d3b1b8b64482c1b392c54d74bd46255c464fb4640171c909784896d114

Contents?: true

Size: 577 Bytes

Versions: 9

Compression:

Stored size: 577 Bytes

Contents

require 'spec_helper'
require 'command_mapper/sudo'

describe CommandMapper::Sudo do
  let(:command) { %w[ls -la /root] }

  subject { described_class.new({command: command}) }

  describe "#initialize" do
    it "must accept a command keyword" do
      expect(subject.command).to eq(command)
    end
  end

  describe "#argv" do
    it "the first argument must be 'sudo'" do
      expect(subject.command_argv.first).to eq('sudo')
    end

    it "must end with the command arguments" do
      expect(subject.command_argv[-command.length..-1]).to eq(command)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
command_mapper-0.3.2 spec/sudo_spec.rb
command_mapper-0.3.1 spec/sudo_spec.rb
command_mapper-0.3.0 spec/sudo_spec.rb
command_mapper-0.2.1 spec/sudo_spec.rb
command_mapper-0.2.0 spec/sudo_spec.rb
command_mapper-0.1.2 spec/sudo_spec.rb
command_mapper-0.1.1 spec/sudo_spec.rb
command_mapper-0.1.0 spec/sudo_spec.rb
command_mapper-0.1.0.pre1 spec/sudo_spec.rb