Sha256: a0d736cdf260bbb9c69d5e38804a9d130fa302491a8e9930a5bc80f1011d5199

Contents?: true

Size: 728 Bytes

Versions: 5

Compression:

Stored size: 728 Bytes

Contents

# frozen_string_literal: true

require_relative '..\..\spec_helper'
require_relative '..\..\..\lib\dendroid\syntax\terminal'
require_relative '..\..\..\lib\dendroid\syntax\non_terminal'
require_relative '..\..\..\lib\dendroid\syntax\rule'

describe Dendroid::Syntax::Rule do
  let(:num_symb) { Dendroid::Syntax::Terminal.new('NUMBER') }
  let(:expr_symb) { Dendroid::Syntax::NonTerminal.new('expression') }

  subject { described_class.new(expr_symb) }

  context 'Initialization:' do
    it 'is initialized with a non-terminal' do
      expect { described_class.new(expr_symb) }.not_to raise_error
    end

    it 'knows its head (aka lhs)' do
      expect(subject.head).to eq(expr_symb)
    end
  end # context
end # describe

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dendroid-0.0.7 spec/dendroid/syntax/rule_spec.rb
dendroid-0.0.6 spec/dendroid/syntax/rule_spec.rb
dendroid-0.0.5 spec/dendroid/syntax/rule_spec.rb
dendroid-0.0.4 spec/dendroid/syntax/rule_spec.rb
dendroid-0.0.3 spec/dendroid/syntax/rule_spec.rb