File: test_spec.rb

package info (click to toggle)
ruby-tty-command 0.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 452 kB
  • sloc: ruby: 1,990; makefile: 4; sh: 4
file content (11 lines) | stat: -rw-r--r-- 359 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
# frozen_string_literal: true

RSpec.describe TTY::Command, "#test" do
  it "implements classic bash command" do
    cmd = TTY::Command.new
    result = double(success?: true)
    allow(cmd).to receive(:run!).with(:test, "-e /etc/passwd").and_return(result)
    expect(cmd.test("-e /etc/passwd")).to eq(true)
    expect(cmd).to have_received(:run!)
  end
end