Sha256: bc11df0ea826fcd4e08136fb3beb4327975dccb31eb2e6ff0a08d16b6b80e761

Contents?: true

Size: 749 Bytes

Versions: 3

Compression:

Stored size: 749 Bytes

Contents

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

    subject{ Shell.from_argv(argv, Ordering) }

    context "on an empty array" do
      let(:argv){ [] }
      it{ should eq(Ordering.new([])) }
    end

    context "on a singleton" do
      let(:argv){ ["hello"] }
      it{ should eq(Ordering.new([[:hello, :asc]])) }
    end

    context "on multiple strings without explit directions" do
      let(:argv){ ["hello", "world"] }
      it{ should eq(Ordering.new([[:hello, :asc], [:world, :asc]])) }
    end

    context "on multiple strings with explit directions" do
      let(:argv){ ["hello", "asc", "world", "desc"] }
      it{ should eq(Ordering.new([[:hello, :asc], [:world, :desc]])) }
    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_ordering.rb
alf-shell-0.13.1 spec/unit/from_argv/test_to_ordering.rb
alf-shell-0.13.0 spec/unit/from_argv/test_to_ordering.rb