Sha256: 463d7d2485e152b630a165a09d7ab29e3b29e0b2872d1bedab56a3547d2eac1f

Contents?: true

Size: 694 Bytes

Versions: 2

Compression:

Stored size: 694 Bytes

Contents

require 'base_test'

module ExecutionStrategy
  class TestMRI < BaseTest
    include OptparsePlus::ExecutionStrategy

    test_that "run_command isn't implemented" do
      Given new_mri_strategy
      When {
        @code = lambda { @strategy.run_command("ls") }
      }
      Then {
        assert_raises(RuntimeError,&@code)
      }
    end

    test_that "exception_meaning_command_not_found returns Errno::ENOENT" do
      Given new_mri_strategy
      When {
        @klass = @strategy.exception_meaning_command_not_found
      }
      Then {
        @klass.should == Errno::ENOENT
      }
    end

  private
    def new_mri_strategy
      lambda { @strategy = MRI.new }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
optparse-plus-3.0.1 test/unit/execution_strategy/test_mri.rb
optparse-plus-3.0.0 test/unit/execution_strategy/test_mri.rb