Sha256: 326cc9de8dd5607cdad8c0d71e7d621844e52e7a886302e3972da1df332a1d7d

Contents?: true

Size: 744 Bytes

Versions: 4

Compression:

Stored size: 744 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Evaluator::Context, '#send' do
  subject { object.send(method, args, &block) }

  let(:attribute) { Attribute::Integer.new(:id)         }
  let(:header)    { Relation::Header.new([ attribute ]) }
  let(:object)    { described_class.new(header) {}      }
  let(:method)    { :test                               }
  let(:args)      { mock('Arguments')                   }
  let(:block)     { proc {}                             }

  before do
    def object.test(args, &block)
      return args, block
    end
  end

  it 'delegates the arguments to the method' do
    subject[0].should equal(args)
  end

  it 'delegates the block to the method' do
    subject[1].should equal(block)
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

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