Class: SpecInfra::Backend::ShellScript
- Defined in:
- lib/specinfra/backend/shellscript.rb
Defined Under Namespace
Classes: Writer
Instance Method Summary collapse
-
#initialize ⇒ ShellScript
constructor
A new instance of ShellScript.
- #run_command(cmd, opts = {}) ⇒ Object
Methods inherited from Base
#check_zero, #commands, #method_missing, #set_commands, #set_example
Constructor Details
#initialize ⇒ ShellScript
Returns a new instance of ShellScript.
6 7 8 9 |
# File 'lib/specinfra/backend/shellscript.rb', line 6 def initialize @lines = [ "#!/bin/sh", "" ] ObjectSpace.define_finalizer(self, Writer.new("spec.sh", @lines)) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SpecInfra::Backend::Base
Instance Method Details
#run_command(cmd, opts = {}) ⇒ Object
11 12 13 14 |
# File 'lib/specinfra/backend/shellscript.rb', line 11 def run_command(cmd, opts={}) @lines << cmd CommandResult.new end |