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

cross_spec

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cross_spec

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

CrossSpec

A utility library for marking cross app testing easier with tools for distributed factories, test parallelism, and verification of async events.

Installation

Add this line to your application's Gemfile:

gem 'cross_spec'

And then execute:

$ bundle

Usage

Listen for service requests in your app

CrossSpec.handle("app1:create_user") do
  # create a user in here
  # then tell the spec that the data is ready
  CrossSpec.beacon("app1:user_created", {id: 123})
end

CrossSpec.listen! # blocks forever

Notify of side effects in your app

CrossSpec.beacon("app1:background_job1_success")

Notify of failures in your app

CrossSpec.failure_beacon!

Ask for data in a spec and wait for it

CrossSpec::Spec.trace do
  user = sync(service: "app1:create_user", {email: "email@example.com"}, tasks: "app1:user_created")
  user["id"] # 123
end

Ask for data in a spec async and wait for it later

CrossSpec::Spec.trace do
  async(service: "app1:create_user", {email: "email@example.com"})
  async(service: "app2:create_blogpost", {title: "Read me"})
  # keep doing things if you want ...

  # block until the data is all ready
  user, blogpost = await(tasks: ["app1:user_created", "app2:blogpost_created"])
end

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bundle exec rspec to run the tests.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cross_spec.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 20 Apr 2018

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