Sha256: b915fa6020412b12849f333e0eb204261bc20e3d734c7cfcc821f1fe309e6482

Contents?: true

Size: 1.06 KB

Versions: 12

Compression:

Stored size: 1.06 KB

Contents

require "pact_broker/config/space_delimited_string_list"

module PactBroker
  module Config
    describe SpaceDelimitedStringList do
      describe "parse" do
        subject { SpaceDelimitedStringList.parse(input) }

        context "when input is ''" do
          let(:input) { "" }

          it { is_expected.to eq [] }

          its(:to_s) { is_expected.to eq input }
        end

        context "when input is 'foo bar'" do
          let(:input) { "foo bar" }

          it { is_expected.to eq ["foo", "bar"] }

          it { is_expected.to be_a SpaceDelimitedStringList }

          its(:to_s) { is_expected.to eq input }
        end

        context "when input is '/foo.*/'" do
          let(:input) { "/foo.*/" }

          it { is_expected.to eq [/foo.*/] }

          its(:to_s) { is_expected.to eq input }
        end

        context "when input is '/foo\\.*/' (note double backslash)" do
          let(:input) { "/foo\\.*/" }

          it { is_expected.to eq [/foo\.*/] }

          its(:to_s) { is_expected.to eq input }
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pact_broker-2.89.1 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.89.0 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.88.0 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.87.0 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.86.0 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.85.1 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.85.0 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.84.0 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.83.0 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.82.0 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.81.0 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb
pact_broker-2.80.0 spec/lib/pact_broker/config/space_delimited_string_list_spec.rb