Sha256: decba756eb0d44773c4b90910afb9a4c9211206eb4f1bded90809335fbfe6e6d
Contents?: true
Size: 379 Bytes
Versions: 35
Compression:
Stored size: 379 Bytes
Contents
module Mod include Contracts::Core Contract C::Num => C::Num def self.a_module_method a a + 1 end end RSpec.describe "module methods" do it "should pass for correct input" do expect { Mod.a_module_method(2) }.to_not raise_error end it "should fail for incorrect input" do expect { Mod.a_module_method("bad") }.to raise_error(ContractError) end end
Version data entries
35 entries across 26 versions & 7 rubygems