Sha256: 36aa8ecbfe15a269ca70a702c3a2d18f0463554a7b535753f00c7a3fddcf6798

Contents?: true

Size: 755 Bytes

Versions: 1

Compression:

Stored size: 755 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 be(attribute) }
  end

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

    let(:args) { double('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

1 entries across 1 versions & 1 rubygems

Version Path
axiom-0.1.1 spec/unit/axiom/evaluator/context/method_missing_spec.rb