Sha256: 3d83584ca28cfdc9be3195fb1fca16e4aa1bffb1cff2fdff9efa9e96dc3ff608

Contents?: true

Size: 982 Bytes

Versions: 8

Compression:

Stored size: 982 Bytes

Contents

require 'spec_helper'
module Grape
  module Util
    describe 'StrictHashConfiguration' do
      subject do
        Class.new do
          include Grape::Util::StrictHashConfiguration.module(:config1, :config2, config3: [:config4], config5: [config6: [:config7, :config8]])
        end
      end

      it 'set nested configs' do
        subject.configure do
          config1 'alpha'
          config2 'beta'

          config3 do
            config4 'gamma'
          end

          local_var = 8

          config5 do
            config6 do
              config7 7
              config8 local_var
            end
          end
        end

        expect(subject.settings).to eq(config1: 'alpha',
                                       config2: 'beta',
                                       config3: { config4: 'gamma' },
                                       config5: { config6: { config7: 7, config8: 8 } }
                                      )
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
grape-0.18.0 spec/grape/util/strict_hash_configuration_spec.rb
grape-0.17.0 spec/grape/util/strict_hash_configuration_spec.rb
grape-0.16.2 spec/grape/util/strict_hash_configuration_spec.rb
grape-0.16.1 spec/grape/util/strict_hash_configuration_spec.rb
grape-0.15.0 spec/grape/util/strict_hash_configuration_spec.rb
grape-0.14.0 spec/grape/util/strict_hash_configuration_spec.rb
grape-0.13.0 spec/grape/util/strict_hash_configuration_spec.rb
grape-0.12.0 spec/grape/util/strict_hash_configuration_spec.rb