Sha256: ee8124ddf4036f43f33b5aae12b34b5226db66873b66f6d38fa1390de8ef6428

Contents?: true

Size: 663 Bytes

Versions: 3

Compression:

Stored size: 663 Bytes

Contents

require 'spec_helper'
module Alf
  describe Shell, ".from_argv(argv, Boolean)" do

    subject{ Shell.from_argv(argv, Boolean) }

    context "with a String" do
      let(:argv){ %w{true} }
      it{ should eq(true) }
    end

    context "with nothing" do
      let(:argv){ %w{} }
      it{ should eq(false) }
    end

    context "with an invalid string" do
      let(:argv){ %w{hello} }
      specify{
        lambda{ subject }.should raise_error(Myrrha::Error)
      }
    end

    context "with more than one string" do
      let(:argv){ %w{hello world} }
      specify{
        lambda{ subject }.should raise_error(Myrrha::Error)
      }
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alf-shell-0.14.0 spec/unit/from_argv/test_to_boolean.rb
alf-shell-0.13.1 spec/unit/from_argv/test_to_boolean.rb
alf-shell-0.13.0 spec/unit/from_argv/test_to_boolean.rb