Sha256: 9abb432521f5925ccc0748260a2d0f40fdd872a730935318ec8d9ffcb518fa0f

Contents?: true

Size: 762 Bytes

Versions: 3

Compression:

Stored size: 762 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Evaluator::Context, '#method_missing' do
  let(:attribute) { Attribute::Integer.new(:id)         }
  let(:header)    { Relation::Header.new([ attribute ]) }
  let(:object)    { described_class.new(header) {}      }

  context 'with a valid attribute' do
    subject { object.id }

    it { should equal(attribute) }
  end

  context 'with a valid attribute and extra arguments' do
    subject { object.id(args) }

    let(:args) { mock('Arguments') }

    specify { expect { subject }.to raise_error(ArgumentError, 'wrong number of arguments (1 for 0)') }
  end

  context 'with an unknown attribute' do
    subject { object.unknown }

    specify { expect { subject }.to raise_error(NoMethodError) }
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
axiom-0.1.0 spec/unit/axiom/evaluator/context/method_missing_spec.rb
veritas-0.0.6 spec/unit/veritas/evaluator/context/method_missing_spec.rb
veritas-0.0.5 spec/unit/veritas/evaluator/context/method_missing_spec.rb