Sha256: d8485648656d21fe5f12126401434b28a1c938a889ad02a99b49b79209162436

Contents?: true

Size: 497 Bytes

Versions: 7

Compression:

Stored size: 497 Bytes

Contents

require 'spec_helper'

describe Parslet::Atoms::Repetition do
  include Parslet

  describe "repeat" do
    let(:parslet) { str('a') }
    
    describe "(min, max)" do
      subject { parslet.repeat(1,2) }
      
      it { should_not parse("") }
      it { should parse("a") }
      it { should parse("aa") }
    end
    describe "0 times" do
      it "raises an ArgumentError" do
        expect {
          parslet.repeat(0,0)
        }.to raise_error(ArgumentError)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
parslet-2.0.0 spec/parslet/atoms/repetition_spec.rb
parslet-1.8.2 spec/parslet/atoms/repetition_spec.rb
parslet-1.8.1 spec/parslet/atoms/repetition_spec.rb
parslet-1.8.0 spec/parslet/atoms/repetition_spec.rb
swift-pyrite-0.1.1 vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/repetition_spec.rb
swift-pyrite-0.1.0 vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/repetition_spec.rb
parslet-1.7.1 spec/parslet/atoms/repetition_spec.rb