Sha256: eaa6ba6a3fe91508378a6e9a9d3b7deeb9bef400f99fab140efa758bc7a5358e

Contents?: true

Size: 1.17 KB

Versions: 26

Compression:

Stored size: 1.17 KB

Contents

Shindo.tests('test_helper', 'meta') do

  tests('#formats_kernel') do

    tests('returns true') do

      test('when format of value matches') do
        formats_kernel({:a => :b}, {:a => Symbol})
      end

      test('when format of nested array elements matches') do
        formats_kernel({:a => [:b, :c]}, {:a => [Symbol]})
      end

      test('when format of nested hash matches') do
        formats_kernel({:a => {:b => :c}}, {:a => {:b => Symbol}})
      end

      test('when format of an array') do
        formats_kernel([{:a => :b}], [{:a => Symbol}])
      end

      test('non strict extra data') do
        formats_kernel({:a => :b, :b => :c}, {:a => Symbol}, true, false)
      end

    end

    tests('returns false') do

      test('when format of value does not match') do
        !formats_kernel({:a => :b}, {:a => String})
      end

      test('when not all keys are checked') do
        !formats_kernel({:a => :b}, {})
      end

      test('when some keys do not appear') do
        !formats_kernel({}, {:a => String})
      end

      test('non strict extra data') do
        !formats_kernel({:a => :b, :b => :c}, {:z => Symbol}, true, false)
      end

    end

  end

end

Version data entries

26 entries across 26 versions & 8 rubygems

Version Path
fog-1.5.0 tests/helpers/formats_helper_tests.rb
rackspace-fog-1.4.2 tests/helpers/formats_helper_tests.rb
fog-1.4.0 tests/helpers/formats_helper_tests.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper_tests.rb
michiels-fog-1.3.1 tests/helpers/formats_helper_tests.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/tests/helpers/formats_helper_tests.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper_tests.rb
fog-1.3.1 tests/helpers/formats_helper_tests.rb
fog-1.3.0 tests/helpers/formats_helper_tests.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper_tests.rb
fog-1.2.0 tests/helpers/formats_helper_tests.rb
ktheory-fog-1.1.2 tests/helpers/formats_helper_tests.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper_tests.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper_tests.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper_tests.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper_tests.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/tests/helpers/formats_helper_tests.rb
fog-1.1.2 tests/helpers/formats_helper_tests.rb
fog_tractical-1.1.4 tests/helpers/formats_helper_tests.rb
fog_tractical-1.1.3 tests/helpers/formats_helper_tests.rb