Sha256: 0b183498c5382882503273965fb319456bb302f874fa56b410b4bfc2d9b95500

Contents?: true

Size: 1.56 KB

Versions: 1

Compression:

Stored size: 1.56 KB

Contents

# encoding: utf-8

require "transproc/rspec"

describe AbstractMapper::Functions, "#subclass?" do

  let(:klass) { Class.new  }
  let(:modul) { Module.new }

  it_behaves_like :transforming_immutable_data do
    let(:arguments) { [:subclass?, klass] }

    let(:input)  { Class.new }
    let(:output) { false     }
  end

  it_behaves_like :transforming_immutable_data do
    let(:arguments) { [:subclass?, klass] }

    let(:input)  { Class.new(Class.new(klass)) }
    let(:output) { true }
  end

  it_behaves_like :transforming_immutable_data do
    let(:arguments) { [:subclass?, modul] }

    let(:input)  { Class.new }
    let(:output) { false }
  end

  it_behaves_like :transforming_immutable_data do
    let(:arguments) { [:subclass?, modul] }

    let(:input)  { Class.new.send :include, modul }
    let(:output) { true }
  end

  it_behaves_like :transforming_immutable_data do
    let(:arguments) { [:subclass?, modul] }

    let(:input)  { Class.new.send :extend, modul }
    let(:output) { false }
  end

  it_behaves_like :transforming_immutable_data do
    let(:arguments) { [:subclass?, modul] }

    let(:input)  { Module.new }
    let(:output) { false }
  end

  it_behaves_like :transforming_immutable_data do
    let(:arguments) { [:subclass?, modul] }

    let(:input)  { Module.new.send :include, modul }
    let(:output) { true }
  end

  it_behaves_like :transforming_immutable_data do
    let(:arguments) { [:subclass?, modul] }

    let(:input)  { Module.new.send :extend, modul }
    let(:output) { false }
  end

end # describe AbstractMapper::Functions#subclass?

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
abstract_mapper-0.0.2 spec/unit/abstract_mapper/functions/subclass_spec.rb