Sha256: 275415ff4653f874367b3d1c2860b8267332b42a6fefeb3de33f32cf25f76b54

Contents?: true

Size: 841 Bytes

Versions: 7

Compression:

Stored size: 841 Bytes

Contents

require 'spec_helper'
module Sexpr
  describe Grammar::Options, "install_parser" do
    include Grammar::Options

    it 'is nil by default' do
      h = {}
      install_options h do
        parser.should be_nil
      end
    end

    it 'can be specified through a :parser option' do
      h = {:parser => bool_expr_parser}
      install_options h do
        parser.should be_a(Parser::Citrus)
      end
    end

    it 'can be specified as a Path' do
      h = {:parser => fixtures_path/"bool_expr.citrus"}
      install_options h do
        parser.should be_a(Parser::Citrus)
      end
    end

    it 'can be specified as relative Path' do
      h = {:path => fixtures_path/"bool_expr.sexp.yml",
           :parser => "bool_expr.citrus"}
      install_options h do
        parser.should be_a(Parser::Citrus)
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sexpr-1.1.0 spec/unit/grammar/options/test_install_parser.rb
sexpr-1.0.0 spec/unit/grammar/options/test_install_parser.rb
sexpr-0.6.0 spec/unit/grammar/options/test_install_parser.rb
sexpr-0.5.1 spec/grammar/options/test_install_parser.rb
sexpr-0.5.0 spec/grammar/options/test_install_parser.rb
sexpr-0.4.0 spec/grammar/options/test_install_parser.rb
sexpr-0.3.0 spec/grammar/options/test_install_parser.rb