Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

its

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

its

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

"Its" makes testing methods with multiple arguments much easier

Tested on MRI Ruby 1.8.7, 1.9.2, 1.9.3, Rubinius (1.8 and 1.9) and JRuby Build Status

Have you ever written something like this in your specs?

it "should be US currency" do
  subject.currency(:us).should == 'US dollar'
end

it "should be AU currency" do
  subject.currency(:au).should == 'AU dollar'
end

it "should be UK currency" do
  subject.currency(:uk).should == 'UK pound'
end

If yes, then this is what you really needed:

its(:currency, :us) { should == 'US dollar' }
its(:currency, :au) { should == 'AU dollar' }
its(:currency, :uk) { should == 'UK pound' }

Installation and use

Add to your Gemfile:

gem 'its'

Then require it somewhere:

require 'its'

And you are done.

Help

Please report any issues here or better submit a Pull Request.

License:

MIT by me and RSpec guys where this code was extracted from.

FAQs

Package last updated on 22 Aug 2014

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