Sha256: 58ea011f7872ced9b5c9066b28e00f7d2f43da33263579af7ed8cdf31fa3cafa

Contents?: true

Size: 1.04 KB

Versions: 31

Compression:

Stored size: 1.04 KB

Contents

require_relative '../../spec_helper'

# Load the class under test
require_relative '../../../lib/rley/syntax/terminal'

module Rley # Open this namespace to avoid module qualifier prefixes
  module Syntax # Open this namespace to avoid module qualifier prefixes
    describe Terminal do
      let(:sample_name) { 'noun' }
      subject { Terminal.new(sample_name) }

      context 'Initialization:' do
        it 'should be created with a name' do
          expect { Terminal.new('noun') }.not_to raise_error
        end

        it 'should know its name' do
          expect(subject.name).to eq(sample_name)
        end
        
        it 'should know that is a terminal symbol' do
          expect(subject).to be_terminal
        end        
        
        it "should know that isn't nullable" do
          expect(subject).not_to be_nullable
        end
        
        it 'should know that it is generative' do
          expect(subject).to be_generative
        end        
      end # context
    end # describe
  end # module
end # module

# End of file

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
rley-0.7.03 spec/rley/syntax/terminal_spec.rb
rley-0.7.02 spec/rley/syntax/terminal_spec.rb
rley-0.7.01 spec/rley/syntax/terminal_spec.rb
rley-0.7.00 spec/rley/syntax/terminal_spec.rb
rley-0.6.09 spec/rley/syntax/terminal_spec.rb
rley-0.6.08 spec/rley/syntax/terminal_spec.rb
rley-0.6.07 spec/rley/syntax/terminal_spec.rb
rley-0.6.06 spec/rley/syntax/terminal_spec.rb
rley-0.6.05 spec/rley/syntax/terminal_spec.rb
rley-0.6.04 spec/rley/syntax/terminal_spec.rb
rley-0.6.03 spec/rley/syntax/terminal_spec.rb
rley-0.6.02 spec/rley/syntax/terminal_spec.rb
rley-0.6.01 spec/rley/syntax/terminal_spec.rb
rley-0.6.00 spec/rley/syntax/terminal_spec.rb
rley-0.5.14 spec/rley/syntax/terminal_spec.rb
rley-0.5.13 spec/rley/syntax/terminal_spec.rb
rley-0.5.12 spec/rley/syntax/terminal_spec.rb
rley-0.5.11 spec/rley/syntax/terminal_spec.rb
rley-0.5.10 spec/rley/syntax/terminal_spec.rb
rley-0.5.09 spec/rley/syntax/terminal_spec.rb