Sha256: c7c87cdd0bbf64a12a83dd175bf6fba391a0161cba5186922c0585510bcc61fb

Contents?: true

Size: 883 Bytes

Versions: 1

Compression:

Stored size: 883 Bytes

Contents

require 'spec_helper'

describe Crystal::Meta do
  def options
    subject.send(:options)
  end

  context '#store' do
    it 'stringifies keys' do
      subject.store :title => 'something'
      subject.store :head => 'something else'
      expect(options).to eq Hash['title' => 'something', 'head' => 'something else']
    end

    it 'merges options deeply' do
      subject.store({
        :og => {
          :title => 'og title',
          :site_name => 'site name'
        }
      })

      subject.store({
        'og' => {
          'site_name' => 'site name 2',
          'url' => 'something',
        },
        :"fb:admins" => '322132'
      })

      expect(options).to eq Hash[
        'og' => {
          'title' => 'og title',
          'site_name' => 'site name 2',
          'url' => 'something',
        },
        'fb:admins' => '322132'
      ]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
crystalmeta-1.0.0 spec/unit/meta_spec.rb