Module: Daylight

Extended by:
ActiveSupport::Autoload
Defined in:
lib/daylight.rb,
lib/daylight/mock.rb,
lib/daylight/version.rb

Overview

Simple mocking framework that simplifies the process of writing tests for code that uses the Daylight client library.

Works with both Rspec and TestUnit/Minitest.

To start add this to your test_helper.rb or spec_helper.rb:

Daylight::Mock.setup

The mock will simulate responses to calls so you don’t have to stub out anything, especially not the HTTP calls themselves. At the end of the test you can examine the calls that were made by calling daylight_mock.

For example, this call returns a list of all the updated calls made on a Host object:

daylight_mock.updated(:host)

To get only the last request use:

daylight_mock.last_updated(:host)

Supported Calls: *created, updated, associated, indexed, shown, deleted*

Defined Under Namespace

Modules: AssociationPersistance, Associations, Collection, Errors, Mock, ReadOnly, Refinements, ReflectionExt, Version Classes: API, ResourceProxy

Constant Summary collapse

VERSION =
STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')