Sha256: ce2e21aa41cbc35ebc5e8466e499791aa264cbdc59889b93195b5e3abf40b8fb

Contents?: true

Size: 856 Bytes

Versions: 1

Compression:

Stored size: 856 Bytes

Contents

require 'spec_helper'

describe ::Rubiks::Measure do
  include_context 'schema_context'

  subject { described_class.new_from_hash }

  specify { subject.respond_to?(:from_hash) }
  specify { subject.respond_to?(:to_hash) }
  specify { subject.respond_to?(:column) }
  specify { subject.respond_to?(:aggregator) }
  specify { subject.respond_to?(:format_string) }

  context 'when parsed from a valid hash' do
    subject { described_class.new_from_hash(measure_hash) }

    it { should be_valid }

    its(:to_hash) { should have_key('name') }
    its(:to_hash) { should have_key('column') }
    its(:to_hash) { should have_key('aggregator') }
    its(:to_hash) { should have_key('format_string') }
  end

  context 'when parsed from an invalid (empty) hash' do
    subject { described_class.new_from_hash({}) }

    it { should_not be_valid }
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubiks-0.0.4 spec/rubiks/nodes/measure_spec.rb