Sha256: f0c59aaf879671a46951370c7fdf9aac0f7ed946dd4d0861488138e90562a3d3

Contents?: true

Size: 804 Bytes

Versions: 1

Compression:

Stored size: 804 Bytes

Contents

require 'spec_helper'
module Sexpr::Parser
  describe Citrus, "new" do

    it 'factors a Parser instance when a Citrus::Grammar' do
      p = Citrus.new(bool_expr_parser)
      p.should be_a(Citrus)
      p.parser.should eq(bool_expr_parser)
    end

    it 'factors a Parser instance when a Path to a .citrus file' do
      p = Citrus.new(fixtures_path/"bool_expr.citrus")
      p.should be_a(Citrus)
      p.parser.should eq(bool_expr_parser)
    end

    it 'factors a Parser instance when a Path to a .citrus file' do
      p = Citrus.new (fixtures_path/"bool_expr.citrus").to_s
      p.should be_a(Citrus)
      p.parser.should eq(bool_expr_parser)
    end

    it 'passes the options' do
      Citrus.new(bool_expr_parser, {:hello => "World"}).options[:hello].should eq("World")
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sexpr-0.3.0 spec/parser/citrus/test_new.rb