Sha256: 29255e64faf52b97a91b990aa37d8d4b0ff205e336e14256cef9e3bdf3078e03

Contents?: true

Size: 761 Bytes

Versions: 1

Compression:

Stored size: 761 Bytes

Contents

require 'spec_helper'
require 'ostruct'

describe Thunderer::Parser do

  let(:object) { OpenStruct.new(first: 1, second: 2) }

  describe '#interpolate_channel' do
    subject { Thunderer::Parser.interpolate_channel(channel, object) }

    context 'when channel have no interpolation' do
      let(:channel) { 'without interpolation string' }

      it { is_expected.to  eq(channel) }
    end

    context 'when channel have one interpolation sequence' do
      let(:channel) { '/hello/:first' }

      it { is_expected.to include('1') }

    end

    context 'when channel have two interpolations' do
      let(:channel) { '/hello/:first/world/:second' }

      it { is_expected.to include('1') }

      it { is_expected.to include('2') }
    end


  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thunderer-1.0.0 spec/thunderer/parser_spec.rb