Sha256: 034e39bdbf0af9835e83fe27fcacd81b83c98ca8fd4e258e5a4648d2e57cf311

Contents?: true

Size: 640 Bytes

Versions: 1

Compression:

Stored size: 640 Bytes

Contents

require 'spec_helper'
module Sexpr
  describe Sexpr, "load" do

      let(:grammar){ Sexpr.load(arg) }

      context "on grammar.yml" do
        let(:arg){ Path.dir/"grammar.yml" }

        it 'returns a Grammar' do
          grammar.should be_a(Grammar)
        end

      end # grammar.yml

      context 'with a Hash' do
        let(:arg){ {:hello => /[a-z]+/} }

        it 'returns a Grammar' do
          grammar.should be_a(Grammar)
        end

      end

      context 'with a String' do
        let(:arg){ "hello: true" }

        it 'returns a Grammar' do
          grammar.should be_a(Grammar)
        end

      end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sexpr-0.2.0 spec/test_load.rb