Sha256: e54f6c4829f0cb2661a51d0f201fd218d9dfed6fc7ef172bd35888e9c53836cf

Contents?: true

Size: 750 Bytes

Versions: 3

Compression:

Stored size: 750 Bytes

Contents

require 'spec_helper'
require 'sugar-high/array'

describe "SugarHigh" do
  describe "Array ext" do
    describe '#to_symbols' do    
      it "should translate nested array of numbers and strings into symbols only array, excluding numbers" do
        [1, 'blip', [3, "hello"]].to_symbols.should == [:blip, :hello]
      end

      it "should translate nested array of numbers and strings into symbols only array, including numbers" do
        [[1, 'blip', [3, "hello"]]].to_symbols(:num).should == [:_1, :blip, :_3, :hello]        
      end

      it "should translate nested array of numbers and strings into strings only array" do
        [['blip', [3, :hello]]].to_strings.should == ['blip', 'hello']        
      end
    end        
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sugar-high-0.2.10 spec/sugar-high/array_spec.rb
sugar-high-0.2.9 spec/sugar-high/array_spec.rb
sugar-high-0.2.8 spec/sugar-high/array_spec.rb