New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

degect

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

degect

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Degect

Dependency injection made easy

Installation

Add this line to your application's Gemfile:

gem 'degect'

And then execute:

$ bundle

Or install it yourself as:

$ gem install degect

Usage

Your Account class:

class Account
  extend Degect
  dependency(:authenticator) { RealAuthenticator.new }

  def authenticate
    authenticator.authenticate_with street_creds
  end
end

Your Account tests:

describe Account do

  it 'authenticates well' do
    fake_authenticator = FakeAuthenticator.new
    subject.authenticator = fake_authenticator

    subject.authenticate

    fake_authenticator.should be_authenticated
  end

end

Contributing

  1. Fork it
  2. Write features with tests
  3. Create new Pull Request

FAQs

Package last updated on 11 Apr 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc