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-openflighthpc-2.0.2 spec/core_ext/array_spec.rb
commander-openflighthpc-2.0.1 spec/core_ext/array_spec.rb
commander-openflighthpc-2.0.0 spec/core_ext/array_spec.rb
commander-4.5.2 spec/core_ext/array_spec.rb
commander-4.5.1 spec/core_ext/array_spec.rb
commander-4.5.0 spec/core_ext/array_spec.rb
commander-openflighthpc-1.2.0 spec/core_ext/array_spec.rb
commander-openflighthpc-1.1.2 spec/core_ext/array_spec.rb
commander-openflighthpc-1.1.1 spec/core_ext/array_spec.rb
commander-openflighthpc-1.1.0 spec/core_ext/array_spec.rb
commander-openflighthpc-1.0.0 spec/core_ext/array_spec.rb
commander-openflighthpc-1.0.0.pre.alpha1 spec/core_ext/array_spec.rb
commander-4.4.7 spec/core_ext/array_spec.rb
murano-cli-commander-4.4.10 spec/core_ext/array_spec.rb
commander-4.4.6 spec/core_ext/array_spec.rb
commander-4.4.5 spec/core_ext/array_spec.rb
commander-fastlane-4.4.6 spec/core_ext/array_spec.rb
commander-4.4.4 spec/core_ext/array_spec.rb
commander-fastlane-4.4.5 spec/core_ext/array_spec.rb
commander-fastlane-4.4.4 spec/core_ext/array_spec.rb