Sha256: 2f12b84ba9e1606bd8c54212bf40a8e171e67a9dfa372e7505ed5eece1b30830

Contents?: true

Size: 833 Bytes

Versions: 23

Compression:

Stored size: 833 Bytes

Contents

require_relative '../../spec_helper'

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

module Rley # Open this namespace to avoid module qualifier prefixes
  module Syntax # Open this namespace to avoid module qualifier prefixes
    describe Literal do
      let(:sample_name) { 'ordinal' }
      subject { Literal.new(sample_name, /\d+/) }

      context 'Initialization:' do
        it 'should be created with a name and regexp' do
          expect { Literal.new(sample_name, /\d+/) }.not_to raise_error
        end

        it 'should know its name' do
          expect(subject.name).to eq(sample_name)
        end

        it 'should know its pattern' do
          expect(subject.pattern).to eq(/\d+/)
        end
      end # context

    end # describe
  end # module
end # module

# End of file

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rley-0.1.08 spec/rley/syntax/literal_spec.rb
rley-0.1.07 spec/rley/syntax/literal_spec.rb
rley-0.1.06 spec/rley/syntax/literal_spec.rb
rley-0.1.05 spec/rley/syntax/literal_spec.rb
rley-0.1.04 spec/rley/syntax/literal_spec.rb
rley-0.1.03 spec/rley/syntax/literal_spec.rb
rley-0.1.02 spec/rley/syntax/literal_spec.rb
rley-0.1.01 spec/rley/syntax/literal_spec.rb
rley-0.1.00 spec/rley/syntax/literal_spec.rb
rley-0.0.18 spec/rley/syntax/literal_spec.rb
rley-0.0.17 spec/rley/syntax/literal_spec.rb
rley-0.0.16 spec/rley/syntax/literal_spec.rb
rley-0.0.15 spec/rley/syntax/literal_spec.rb
rley-0.0.14 spec/rley/syntax/literal_spec.rb
rley-0.0.13 spec/rley/syntax/literal_spec.rb
rley-0.0.12 spec/rley/syntax/literal_spec.rb
rley-0.0.11 spec/rley/syntax/literal_spec.rb
rley-0.0.10 spec/rley/syntax/literal_spec.rb
rley-0.0.09 spec/rley/syntax/literal_spec.rb
rley-0.0.08 spec/rley/syntax/literal_spec.rb