Sha256: e334f651798c2171a242bdf36991647aa09dedd5b8dbea4c5c168689dcb80d1f
Contents?: true
Size: 1.15 KB
Versions: 17
Compression:
Stored size: 1.15 KB
Contents
require_relative '../../spec_helper' # Load the class under test require_relative '../../../lib/rley/syntax/non_terminal' module Rley # Open this namespace to avoid module qualifier prefixes module Syntax # Open this namespace to avoid module qualifier prefixes describe NonTerminal do let(:sample_name) { 'noun' } subject { NonTerminal.new(sample_name) } context 'Initialization:' do it 'should be created with a name' do expect { NonTerminal.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 not a terminal' do expect(subject).not_to be_terminal end end # context context 'Provided services:' do it 'should know whether it is nullable' do expect(subject.nullable?).to be_nil subject.nullable = true expect(subject).to be_nullable subject.nullable = false expect(subject).not_to be_nullable end end # context end # describe end # module end # module # End of file
Version data entries
17 entries across 17 versions & 1 rubygems