Sha256: b5a353b746ccea4fa0f2a92d35800f9ddbff2a6eaf10c8ecad35ef3dc99042ff

Contents?: true

Size: 864 Bytes

Versions: 3

Compression:

Stored size: 864 Bytes

Contents

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

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

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

    context "--no-allbut" do
      let(:argv){ [input, "--", "a", "b"] }
      specify{
        subject.attributes.should eq(Alf::AttrList[:a, :b])
        subject.allbut.should eq(false)
      }
    end

    context "--allbut" do
      let(:argv){ [input, "--allbut", "--", "a", "b"] }
      specify{
        subject.attributes.should eq(Alf::AttrList[:a, :b])
        subject.allbut.should eq(true)
      }
    end

    context "none projected" do
      let(:argv){ [input] }
      specify{
        subject.attributes.should eq(Alf::AttrList[])
        subject.allbut.should eq(false)
      }
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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