Sha256: cb34f58e9509eddf5e0ad340d40c864a02adb7b06ebbe6e64cca28f6452bbeb4

Contents?: true

Size: 735 Bytes

Versions: 2

Compression:

Stored size: 735 Bytes

Contents

require 'spec_helper'

shared_examples_for "Function" do |method,arguments=[],additional_arguments=[]|
  describe "##{method}" do
    let(:name) { method.upcase }
    let(:func) { subject.send(method,*arguments) }

    it "should create a #{method.upcase} function" do
      func.name.should == name
    end

    unless arguments.empty?
      it "should set the arguments" do
        func.arguments.should == arguments
      end
    end

    unless additional_arguments.empty?
      context "when passed additional arguments" do
        let(:func) { subject.send(method,*additional_arguments) }

        it "should set the arguments" do
          func.arguments.should == additional_arguments
        end
      end
    end
  end
end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ronin-sql-1.1.0 spec/sql/function_examples.rb
ronin-sql-1.0.0 spec/sql/function_examples.rb