Sha256: 055e84ff351ee813e7e7bfa2d756856e001e180e1fa68b1864ef34f4c9227e0b

Contents?: true

Size: 689 Bytes

Versions: 3

Compression:

Stored size: 689 Bytes

Contents

require 'spec_helper'
module Alf::Shell::Operator
  describe Rank do

    let(:input){ suppliers }
    subject{ Rank.run(argv) }

    before do
      subject.should be_a(Alf::Algebra::Rank)
      subject.operands.should eq([input])
    end

    context "without name" do
      let(:argv){ [input, "--", "time"] }
      specify{
        subject.order.should eq(Alf::Ordering[[:time, :asc]])
        subject.as.should eq(:rank)
      }
    end

    context "with explicit name" do
      let(:argv){ [input, "--","time", "desc", "--", "newname"] }
      specify{
        subject.order.should eq(Alf::Ordering[[:time, :desc]])
        subject.as.should eq(:newname)
      }
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alf-shell-0.14.0 spec/unit/operator/test_rank.rb
alf-shell-0.13.1 spec/unit/operator/test_rank.rb
alf-shell-0.13.0 spec/unit/operator/test_rank.rb