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

Version Path
contracts-0.17.2 spec/module_spec.rb
contracts-0.17.1 spec/module_spec.rb
entitlements-app-1.1.0 lib/contracts-ruby3/spec/module_spec.rb
entitlements-app-1.1.0 lib/contracts-ruby2/spec/module_spec.rb
entitlements-app-1.0.0 lib/contracts-ruby2/spec/module_spec.rb
entitlements-app-1.0.0 lib/contracts-ruby3/spec/module_spec.rb
entitlements-app-0.3.4 lib/contracts-ruby3/spec/module_spec.rb
entitlements-app-0.3.4 lib/contracts-ruby2/spec/module_spec.rb
entitlements-app-0.3.1 lib/contracts-ruby3/spec/module_spec.rb
entitlements-app-0.3.1 lib/contracts-ruby2/spec/module_spec.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/contracts-0.17/spec/module_spec.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/contracts-0.17/spec/module_spec.rb
entitlements-app-0.3.0 lib/contracts-ruby3/spec/module_spec.rb
entitlements-app-0.3.0 lib/contracts-ruby2/spec/module_spec.rb
entitlements-0.2.1 lib/contracts-ruby2/spec/module_spec.rb
entitlements-0.2.1 lib/contracts-ruby3/spec/module_spec.rb
entitlements-app-0.2.1 lib/contracts-ruby2/spec/module_spec.rb
entitlements-app-0.2.1 lib/contracts-ruby3/spec/module_spec.rb
entitlements-0.2.0 lib/contracts-ruby3/spec/module_spec.rb
entitlements-0.2.0 lib/contracts-ruby2/spec/module_spec.rb