Sha256: 2501165d279f5e4fb6df0dc0a3e854e502174c04dc8ef5b15ff30a09f6c73e28

Contents?: true

Size: 945 Bytes

Versions: 2

Compression:

Stored size: 945 Bytes

Contents

require 'spec_helper'
require 'ronin/sql/fields'

describe SQL::Fields do
  subject { Object.new.extend(described_class) }

  describe "#respond_to_missing?" do
    it "should return true" do
      subject.respond_to_missing?(double(:method)).should be(true)
    end
  end

  its(:to_ary) { should be_nil }

  describe "#method_missing" do
    let(:name) { 'users' }

    context "when called with no arguments and no block" do
      it "should create a Field" do
        subject.send(name).name.should == name
      end
    end

    context "when called with arguments" do
      it "should raise a NoMethodError" do
        lambda {
          subject.sned(name,1,2,3)
        }.should raise_error(NoMethodError)
      end
    end

    context "when called with a block" do
      it "should raise a NoMethodError" do
        lambda {
          subject.sned(name) { 1 + 1 }
        }.should raise_error(NoMethodError)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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