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

irumugam

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

irumugam

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
3
Created
Source

Irumugam

Build Status

Irumugam - The two faced framework helps you setup a DSL for describing services. The one face helps you test the services using RSpec while the other runs it as a mock for consuming them.

To include irumugam in your project, add it to your Gemfile

gem 'irumugam'

Usage

To you can describe a service this way using irumugam

# service.rb
include Irumugam

describe_service "My Glorious Service" do
  host "http://testserver"
  end_point "/cart-service"

  before(:each) do
    #do setup stuff
    @test_order = FactoryGirl.create(:order)
  end

  after(:each) do
    DatabaseCleaner.clean
  end

  get "/orders" do
    status 200
    body [FactoryGirl.attributes_for(:order)].to_json
  end

  get "/orders/1" do
    status 200
    json {id:42, name: "Some Name", quantity: 500}, :ignore=>[:id]
  end

  put "/orders/:id", :body=>{:description=>"asdf"}, :type=>:json do
    status 200
    path_object { @test_order.attributes }
    json {id: 42, description: "asdf", count: 50}, :ignore=>[:id]
  end
end

register_with_rspec!

You can now run this as a spec as.

$ rspec service.rb

You can also run this as a mock server by wiring it with config.ru

# config.ru
require './service.rb'

run Irumugam::Server.new

You can run the server with a rack compatible server like thin.

$ thin -R config.ru start

You can then access the mock service with the following.

$ curl http://localhost:3000/cart-service/orders/1

FAQs

Package last updated on 31 Jul 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