Sha256: 8eadcd5f5fc56085ec50ee3af4182a7d8bac4d4486263f5aa28a32af45aec82a

Contents?: true

Size: 825 Bytes

Versions: 4

Compression:

Stored size: 825 Bytes

Contents

require 'spec_helper'

module MARC::Spec
  module Queries
    describe ComparisonString do
      describe :str_exact do
        it 'decodes escapes' do
          expecteds = {
            'value' => 'value',
            '!value' => '!value',
            '\\!value' => '!value',
            '\\svalue' => ' value',
            'value\\!' => 'value!',
            'a\\{b\\}\\$1\\\\23\\=\\~\\|\\?' => 'a{b}$1\\\\23=~|?',
            'help\\sI\\sam\\strapped\\sin\\sa\\sunit\\stest\\!\\sso\\sam\\sI' =>
              'help I am trapped in a unit test! so am I'
          }
          aggregate_failures do
            expecteds.each do |str_raw, expected|
              cstr = ComparisonString.new(str_raw)
              expect(cstr.str_exact).to eq(expected)
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-marc-spec-0.1.3 spec/marc/spec/queries/comparison_string_spec.rb
ruby-marc-spec-0.1.2 spec/marc/spec/queries/comparison_string_spec.rb
ruby-marc-spec-0.1.1 spec/marc/spec/queries/comparison_string_spec.rb
ruby-marc-spec-0.1.0 spec/marc/spec/queries/comparison_string_spec.rb