Sha256: 4ca4aa1a58e34e230e2d41e8a2af86b644be2c886ef97477376db49f07c863db

Contents?: true

Size: 956 Bytes

Versions: 7

Compression:

Stored size: 956 Bytes

Contents

# frozen_string_literal: true

require_relative '../spec_helper' # Use the RSpec framework

# Load the class under test
require_relative '../../lib/loxxy/datatype/lx_string'

module Loxxy
  module Datatype
    describe LXString do
      let(:sample_text) { 'some_text' }
      subject { LXString.new(sample_text) }

      context 'Initialization:' do
        it 'should accept a String value at initialization' do
          expect { LXString.new(sample_text) }.not_to raise_error
        end

        it 'should know its value' do
          expect(subject.value).to eq(sample_text)
        end
      end

      context 'Provided services:' do
        it 'compares with another string' do
          expect(subject).to eq(sample_text)
          expect(subject).to eq(LXString.new(sample_text.dup))

          expect(subject).not_to eq('')
          expect(subject).not_to eq('other-text')
        end
      end
    end # describe
  end # module
end # module

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
loxxy-0.0.11 spec/datatype/lx_string_spec.rb
loxxy-0.0.10 spec/datatype/lx_string_spec.rb
loxxy-0.0.9 spec/datatype/lx_string_spec.rb
loxxy-0.0.8 spec/datatype/lx_string_spec.rb
loxxy-0.0.7 spec/datatype/lx_string_spec.rb
loxxy-0.0.6 spec/datatype/lx_string_spec.rb
loxxy-0.0.5 spec/datatype/lx_string_spec.rb