Sha256: ac3cf0b6bf21b471699fe7c72250c84068e9df80ac91b93ab91fce6db326f9cc

Contents?: true

Size: 695 Bytes

Versions: 12

Compression:

Stored size: 695 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'image_optim/runner/glob_helpers'

describe ImageOptim::Runner::GlobHelpers do
  describe '.expand_braces' do
    {
      'hello.world' => %w[hello.world],
      '{hello,.world}' => %w[hello .world],
      'hello{.,!}world' => %w[hello.world hello!world],
      '{a,b},{c,d}' => %w[a,c b,c a,d b,d],
      '{{a,b},{c,d}}' => %w[a b c d],
      '{a,b,{c,d}}' => %w[a b c d],
      '{\{a,b\},\{c,d\}}' => %w[\\{a b\\} \\{c d\\}],
      'test{ing,}' => %w[testing test],
    }.each do |glob, expected|
      it "expands #{glob}" do
        expect(described_class.expand_braces(glob)).to match_array(expected)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
image_optim-0.31.4 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.31.3 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.31.2 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.31.1 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.31.0 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.30.0 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.29.0 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.28.0 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.27.1 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.27.0 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.26.5 spec/image_optim/runner/glob_helpers_spec.rb
image_optim-0.26.4 spec/image_optim/runner/glob_helpers_spec.rb