Sha256: c94ffd547717ce464440cdab74bea184dfa3a9200e5a5e38edc065621e33106b

Contents?: true

Size: 497 Bytes

Versions: 11

Compression:

Stored size: 497 Bytes

Contents

require "spec_helper"

describe Liquidscript::Scanner do
  subject { described_class.new("42") }
  it { should be_a Enumerable }

  describe "#each" do
    specify { expect(subject.each).to be_a Enumerator }
    specify { expect { |y| subject.each(&y) }.to yield_control.once }
  end

  context "with invalid input" do
    subject { described_class.new("'test'") }

    it "raises an error" do
      expect {
        subject.each
      }.to raise_error Liquidscript::SyntaxError
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
liquidscript-0.3.1 spec/lib/liquidscript/scanner_spec.rb
liquidscript-0.3.0 spec/lib/liquidscript/scanner_spec.rb
liquidscript-0.2.1 spec/lib/liquidscript/scanner_spec.rb
liquidscript-0.2.0 spec/lib/liquidscript/scanner_spec.rb
liquidscript-0.1.5 spec/lib/liquidscript/scanner_spec.rb
liquidscript-0.1.4 spec/lib/liquidscript/scanner_spec.rb
liquidscript-0.1.3 spec/lib/liquidscript/scanner_spec.rb
liquidscript-0.1.2 spec/lib/liquidscript/scanner_spec.rb
liquidscript-0.1.1 spec/lib/liquidscript/scanner_spec.rb
liquidscript-0.1.0 spec/lib/liquidscript/scanner_spec.rb
liquidscript-0.0.1 spec/lib/liquidscript/scanner_spec.rb