Sha256: abf9fef6b9faaadcc89eeb2cfb569dfb534ab330802be8f9c76e9f42fe3409c1
Contents?: true
Size: 689 Bytes
Versions: 39
Compression:
Stored size: 689 Bytes
Contents
module Contracts RSpec.describe Support do describe "eigenclass?" do it "is falsey for non-singleton classes" do expect(Contracts::Support.eigenclass? String).to be_falsey end it "is truthy for singleton classes" do singleton_class = String.instance_exec { class << self; self; end } expect(Contracts::Support.eigenclass? singleton_class).to be_truthy end end describe "eigenclass_of" do it "returns the eigenclass of a given object" do singleton_class = String.instance_exec { class << self; self; end } expect(Contracts::Support.eigenclass_of String).to eq singleton_class end end end end
Version data entries
39 entries across 30 versions & 7 rubygems