Class: Serverspec::Type::Command
- Inherits:
-
Base
- Object
- Base
- Serverspec::Type::Command
show all
- Defined in:
- lib/serverspec/type/command.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #to_s
Instance Method Details
#return_exit_status?(status) ⇒ Boolean
25
26
27
28
|
# File 'lib/serverspec/type/command.rb', line 25
def return_exit_status?(status)
ret = backend.run_command(@name)
ret[:exit_status].to_i == status
end
|
#return_stderr?(content) ⇒ Boolean
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/serverspec/type/command.rb', line 13
def return_stderr?(content)
ret = backend.run_command(@name)
if content.instance_of?(Regexp)
ret[:stdout] =~ content
else
ret[:stdout].strip == content
end
end
|
#return_stdout?(content) ⇒ Boolean
4
5
6
7
8
9
10
11
|
# File 'lib/serverspec/type/command.rb', line 4
def return_stdout?(content)
ret = backend.run_command(@name)
if content.instance_of?(Regexp)
ret[:stdout] =~ content
else
ret[:stdout].strip == content
end
end
|