Sha256: 227f283d50562368adc8663c1ad5116b306bdeae9ef5fcb5291fc41747ed377e

Contents?: true

Size: 716 Bytes

Versions: 2

Compression:

Stored size: 716 Bytes

Contents

require 'spec_helper'

# I need to add support for non triggered actions to cinch-test,
# so this will have to do.
def sudo_command(command = '/bin/echo foo', pass = true)
  "Jun  3 17:32:16 localhost sudo: username : "\
  "#{pass ? '' : '3 incorrect password attempts ; '}"\
  "TTY=ttys007 ; "\
  "PWD=/Users/username ; "\
  "USER=root ; "\
  "COMMAND=#{command}"
end

describe Cinch::Plugins::Sudo do
  include Cinch::Test

  it 'should recognize correct sudo lines' do
    entry = Cinch::Plugins::Sudo::Entry.new(sudo_command)
    expect(entry).to_not be nil
  end

  it 'should marke entries successful' do
    entry = Cinch::Plugins::Sudo::Entry.new(sudo_command)
    expect(entry.success).to be true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cinch-sudo-0.1.1 spec/sudo_spec.rb
cinch-sudo-0.1.0 spec/sudo_spec.rb