Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9147 (closed enhancement: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] Automatically add BDD methods to booleans

Reported by: steveluscher Assigned to: madrobby
Priority: normal Milestone: 1.x
Component: script.aculo.us Version: edge
Severity: normal Keywords: bdd, testing, specifications, booleans
Cc:

Description

unittest.js currently adds BDD methods to Strings, Arrays, and Numbers. This patch makes unittest.js automatically add them to Booleans as well, so that we can start doing things like this:

    var theTruth = true;
    var lies = false;
    
    theTruth.shouldNotBeA(String);
    lies.shouldBeA(Boolean);
    'false'.shouldNotBeA(Boolean);
    
    theTruth.shouldEqual(true);
    lies.shouldNotEqual(true);

Attachments

boolean_bdd_methods_patch.diff (509 bytes) - added by steveluscher on 07/30/07 22:26:43.
A patch to cause the automatic adding of BDD test methods to Booleans.
boolean_bdd_methods_test_patch.diff (0.6 kB) - added by steveluscher on 07/30/07 22:27:11.
Tests for the automatic adding of BDD methods to Booleans

Change History

07/30/07 22:26:43 changed by steveluscher

  • attachment boolean_bdd_methods_patch.diff added.

A patch to cause the automatic adding of BDD test methods to Booleans.

07/30/07 22:27:11 changed by steveluscher

  • attachment boolean_bdd_methods_test_patch.diff added.

Tests for the automatic adding of BDD methods to Booleans

08/07/07 13:20:04 changed by madrobby

  • status changed from new to closed.
  • resolution set to fixed.

(In [7280]) script.aculo.us: Add BDD methods to booleans. Closes #9147.