Sha256: aeb4c2f21360abb4ec5b919544aa53f9c55834ccf066a5016229491b61f3be89

Contents?: true

Size: 485 Bytes

Versions: 42

Compression:

Stored size: 485 Bytes

Contents

require 'spec_helper'

describe Array do
  describe '#parse' do
    it 'should seperate a list of words into an array' do
      expect(Array.parse('just a test')).to eq(%w(just a test))
    end

    it 'should preserve escaped whitespace' do
      expect(Array.parse('just a\ test')).to eq(['just', 'a test'])
    end

    it 'should match %w behavior with multiple backslashes' do
      str = 'just a\\ test'
      expect(Array.parse(str)).to eq(eval("%w(#{str})"))
    end
  end
end

Version data entries

42 entries across 42 versions & 6 rubygems

Version Path
commander-fastlane-4.4.3 spec/core_ext/array_spec.rb
commander-4.4.3 spec/core_ext/array_spec.rb
simple_commander-0.6.1 spec/core_ext/array_spec.rb
simple_commander-0.6.0 spec/core_ext/array_spec.rb
commander-4.4.2 spec/core_ext/array_spec.rb
commander-4.4.1 spec/core_ext/array_spec.rb
simple_commander-0.5.1 spec/core_ext/array_spec.rb
simple_commander-0.5.0 spec/core_ext/array_spec.rb
simple_commander-0.4.0 spec/core_ext/array_spec.rb
simple_commander-0.3.1 spec/core_ext/array_spec.rb
simple_commander-0.3.0 spec/core_ext/array_spec.rb
simple_commander-0.1.0 spec/core_ext/array_spec.rb
commander-4.4.0 spec/core_ext/array_spec.rb
commander-4.3.8 spec/core_ext/array_spec.rb
commander-4.3.7 spec/core_ext/array_spec.rb
commander-4.3.5 spec/core_ext/array_spec.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/commander-4.3.4/spec/core_ext/array_spec.rb
commander-4.3.4 spec/core_ext/array_spec.rb
commander-4.3.3 spec/core_ext/array_spec.rb
commander-4.3.2 spec/core_ext/array_spec.rb