Module: Beaker::CommandFactory
- Includes:
- Minitest::Assertions
- Included in:
- Aix::Exec, Aix::File, Aix::Group, Aix::User, FreeBSD::Exec, FreeBSD::Pkg, Mac::Exec, Mac::Group, Mac::Pkg, Mac::User, PSWindows::Exec, PSWindows::File, PSWindows::Group, PSWindows::Pkg, PSWindows::User, Unix::Exec, Unix::File, Unix::Group, Unix::Pkg, Unix::User, Windows::Exec, Windows::File, Windows::Group, Windows::Pkg, Windows::User
- Defined in:
- lib/beaker/command_factory.rb
Instance Attribute Summary collapse
-
#assertions ⇒ Object
Why do we need this accessor? github.com/seattlerb/minitest/blob/master/lib/minitest/assertions.rb#L8-L12 Protocol: Nearly everything here boils up to
assert, which expects to be able to increment an instance accessor namedassertions.
Instance Method Summary collapse
Instance Attribute Details
#assertions ⇒ Object
Why do we need this accessor? github.com/seattlerb/minitest/blob/master/lib/minitest/assertions.rb#L8-L12 Protocol: Nearly everything here boils up to assert, which expects to be able to increment an instance accessor named assertions. This is not provided by Assertions and must be provided by the thing including Assertions. See Minitest::Runnable for an example.
13 14 15 |
# File 'lib/beaker/command_factory.rb', line 13 def assertions @assertions end |
Instance Method Details
#execute(command, options = {}, &block) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/beaker/command_factory.rb', line 18 def execute(command, ={}, &block) = {} exec_opts = .dup [:prepend_cmds] = exec_opts.delete(:prepend_cmds) || nil [:cmdexe] = exec_opts.delete(:cmdexe) || false result = self.exec(Command.new(command, [], ), exec_opts) if block_given? yield result else result.stdout.chomp end end |
#fail_test(msg) ⇒ Object
32 33 34 |
# File 'lib/beaker/command_factory.rb', line 32 def fail_test(msg) assert(false, msg) end |