Sha256: 16b862563cceabcb4ed3e688204d233e3483124b3287ca5600d397c0f7a7e3b1

Contents?: true

Size: 537 Bytes

Versions: 2

Compression:

Stored size: 537 Bytes

Contents

require "spec_helper"

RSpec.describe Veeqo::Base do
  describe ".method_missing" do
    context "with existing instance method" do
      it "creates a new instace and invoke the method" do
        expect(InheritedBase.valid?).to be_truthy
      end
    end

    context "with non existing instance method" do
      it "raise an default method error" do
        expect { InheritedBase.invalid_method }.to raise_error(NoMethodError)
      end
    end
  end

  class InheritedBase < Veeqo::Base
    def valid?
      true
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
veeqo-0.1.1 spec/veeqo/base_spec.rb
veeqo-0.1.0 spec/veeqo/base_spec.rb