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

be

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

be

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Be - Behaviorial Expectations

"Oh, Behave!"

Website / Report Issue / Source Code / Mailing List

Build Status

Description

Be is a fully versitle, light-weight and BRASS compliant assertions framework for Ruby. It utilizes an assertor design (matchers in RSpec terminology) which meshes well with BDD nomenclatures.

Instruction

Be's usage is very simple. It consits of using #should with a target object, and passing it the reuslt of calling #be or #have with expectation critera. Here is an example:

require 'be'

object = "string"

object.should be.instance_of?(String)
object.should have(6).size

The only difference betwee #be and #have is the default expectation method that is used if none is provided. In the base of #be it is #==, for #have it is #include?.

"abc".should be("abc")

[:a,:b,:c].should have(:b)

Be works on the principle of assertors, a type of functor, or higher-order function. In RSpec these are know as matchers. Be provides the method #should for all Objects which accepts any object that converts to an assertor via a #to_assertor method. The #be and #have method returns just that, a Be::Delegator which orgnaizes all calls made against it to use as expectations in the Be::Assertor.

Copyrights

Copyright (c) 2012 Rubyworks

Be is distributable in accordance with the FreeBSD license.

See License.txt for details.

FAQs

Package last updated on 28 Feb 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