Sha256: 751349138b2922d08b368f4e9e1d964ec4cd8bf8310a33920dd912e99fbfc63b

Contents?: true

Size: 498 Bytes

Versions: 8

Compression:

Stored size: 498 Bytes

Contents

require 'spec_helper'

describe HSS::Parser do
  let(:config) { 'spec/test/config.yml' }
  let(:handler) { HSS::Handler.new config }

  describe '#shortcut' do
    it 'expands shortcut text' do
      expect(handler.handle 'short_a').to eql 'short_ALPHA'
      expect(handler.handle 'short_b').to eql 'short_BETA'
    end
    context 'when an invalid shortcut is used' do
      it 'raises an error' do
        expect { handler.handle 'short_z' }.to raise_error NameError
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hss-1.0.1 spec/helpers/shortcut_spec.rb
hss-1.0.0 spec/helpers/shortcut_spec.rb
hss-0.2.11 spec/helpers/shortcut_spec.rb
hss-0.2.10 spec/helpers/shortcut_spec.rb
hss-0.2.9 spec/helpers/shortcut_spec.rb
hss-0.2.8 spec/helpers/shortcut_spec.rb
hss-0.2.6 spec/helpers/shortcut_spec.rb
hss-0.2.5 spec/helpers/shortcut_spec.rb