Sha256: 993cb6e26e8938b57f44482e5c9f8b854cdbb4babe2a15f0180b1b2e9ff4e173

Contents?: true

Size: 756 Bytes

Versions: 5

Compression:

Stored size: 756 Bytes

Contents

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

    subject{ Generator.run(argv) }

    before do
      subject.should be_a(Alf::Operator::NonRelational::Generator)
      subject.operands.should eq([])
    end

    context "with empty args" do
      let(:argv){ %w{} }
      specify{
        subject.size.should eq(10)
        subject.as.should eq(:num)
      }
    end

    context "with a size" do
      let(:argv){ %w{-- 2} }
      specify{
        subject.size.should eq(2)
        subject.as.should eq(:num)
      }
    end

    context "with a size and a name" do
      let(:argv){ %w{-- 2 -- generated} }
      specify{
        subject.size.should eq(2)
        subject.as.should eq(:generated)
      }
    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_generator.rb
alf-0.12.1 spec/unit/alf-shell/operator/test_generator.rb
alf-0.12.0 spec/unit/alf-shell/operator/test_generator.rb
alf-0.11.1 spec/unit/alf-shell/operator/test_generator.rb
alf-0.11.0 spec/unit/alf-shell/operator/test_generator.rb