Sha256: 6812305267dc720186c8544020a432f3eb66fbab203cc23cb03efe7d1a2cf31b

Contents?: true

Size: 1012 Bytes

Versions: 41

Compression:

Stored size: 1012 Bytes

Contents

# Self-test. Sometimes tests call into utility methods in spec_helper.rb;
# if those aren't doing what they should, then the tests might give false
# positive passes.
#
require 'spec_helper'

RSpec.describe 'spec_helper.rb self-test' do
  context '#spec_helper_hupcase' do
    it 'converts a flat Hash, preserving data type of keys' do
      input  = {:one => 1, 'two' => 2}
      output = spec_helper_hupcase(input)

      expect(output).to eql({:ONE => 1, 'TWO' => 2})
    end

    it 'converts a nested Hash' do
      input  = {:one => 1, 'two' => {:tHrEe => {'fOuR' => 4}}}
      output = spec_helper_hupcase(input)

      expect(output).to eql({:ONE => 1, 'TWO' => {:THREE => {'FOUR' => 4}}})
    end

    it 'converts an Array with Hashes' do
      input  = {:one => 1, 'two' => [true, 42, {:tHrEe => {'fOuR' => 4}}]}
      output = spec_helper_hupcase(input)

      expect(output).to eql({:ONE => 1, 'TWO' => [true, 42, {:THREE => {'FOUR' => 4}}]})
    end
  end # "context '#spec_helper_hupcase' do"
end

Version data entries

41 entries across 41 versions & 2 rubygems

Version Path
scimitar-1.11.0 spec/spec_helper_spec.rb
scimitar-2.10.0 spec/spec_helper_spec.rb
scimitar-1.10.0 spec/spec_helper_spec.rb
scimitar-2.9.0 spec/spec_helper_spec.rb
scimitar-2.8.0 spec/spec_helper_spec.rb
scimitar-2.7.3 spec/spec_helper_spec.rb
powerhome-scimitar-1.0.0 spec/spec_helper_spec.rb
scimitar-2.7.2 spec/spec_helper_spec.rb
scimitar-1.8.2 spec/spec_helper_spec.rb
scimitar-1.8.1 spec/spec_helper_spec.rb
scimitar-2.7.1 spec/spec_helper_spec.rb
scimitar-1.8.0 spec/spec_helper_spec.rb
scimitar-2.7.0 spec/spec_helper_spec.rb
scimitar-1.7.1 spec/spec_helper_spec.rb
scimitar-2.6.1 spec/spec_helper_spec.rb
scimitar-1.7.0 spec/spec_helper_spec.rb
scimitar-2.6.0 spec/spec_helper_spec.rb
scimitar-1.6.0 spec/spec_helper_spec.rb
scimitar-2.5.0 spec/spec_helper_spec.rb
scimitar-2.4.3 spec/spec_helper_spec.rb