Sha256: be0b91aca33747fdc8f50cbb28268dee5994935f6554fa421f07cb7dabdff343

Contents?: true

Size: 685 Bytes

Versions: 5

Compression:

Stored size: 685 Bytes

Contents

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

    let(:input){ [] }
    subject{ Wrap.run(argv) }

    before do
      subject.should be_a(Alf::Operator::Relational::Wrap)
      subject.operands.should eq([input])
    end

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

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

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-0.12.2 spec/unit/alf-shell/operator/test_wrap.rb
alf-0.12.1 spec/unit/alf-shell/operator/test_wrap.rb
alf-0.12.0 spec/unit/alf-shell/operator/test_wrap.rb
alf-0.11.1 spec/unit/alf-shell/operator/test_wrap.rb
alf-0.11.0 spec/unit/alf-shell/operator/test_wrap.rb