Socket
Book a DemoInstallSign in
Socket

dock_test

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dock_test

0.4.8
bundlerRubygems
Version published
Maintainers
1
Created
Source

DockTest Gem

DockTest Gem

Description

DockTest is an outside-in testing framework for ruby service api applications.

Features

Different from the popular Rack::Test, DockTest focuses on just on service applications and tests 100% from outside.

  • 100% end-to-end as it is based on HTTP requests/responses. When testing in local mode, it also racks up the local rack server.
  • same tests can run for all deployment environments - development, test, staging, and production.
  • environment-specific skippy setting to automatically skip tests with requests that create side-effects in production environments.
  • focuses on service applications to strip out sessions, cookies, javascript, file uploads, and other browser-related features.
  • provides custom assertions that are specific to api responses, including schema validation.
  • same methods as Rack::Test for easy test reuse.
  • support for OAuth requests
  • support for displaying equivalent curl command using OUTPUT_CURL environment variable.
  • support for script_name localhost testing.
  • support verify_ssl for specifying whether to enforce ssl verification in http connection. Optional, default is true.

Sample Application

Install

Add this line to your application's Gemfile:

  group :test do
    gem 'dock_test'
  end

And then execute:

$ bundle

In your test helper file (often test/test_helper.rb), include the following DockTest configuration:

DockTest.configure do |c|
  case ENV['DOCK_ENV']
  when 'production'
    c.url = 'http://vast-reaches-9635.herokuapp.com/' # your production service url
    c.skippy = true
  else
    c.url = 'http://localhost:9871' # your local service url with abitary unbound port number
    c.skippy = false
  end
end

Add include DockTest::Methods to give your integration tests access to all the verb test methods and also assertions.

Now you can excute your test collectively or individually, such as:

$ bundle exec rake test
$ DOCK_ENV=production bundle exec rake test

Assumptions

  • when testing local application, a config.ru exists that can be used to rackup the server.

FAQs

Package last updated on 06 Nov 2015

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.