public
Description: Shoulda for JavaScript
Homepage: http://jshoulda.scriptia.net
Clone URL: git://github.com/choan/jshoulda.git
Click here to lend your support to: jshoulda and make a donation at www.pledgie.com !
choan (author)
Sun Mar 22 16:29:34 -0700 2009
commit  d920d1a9a1db3822c1ea9e2ce64cea87434de449
tree    0ba937003a8d1a78bfeeff4196e612db6ee58916
parent  68235cef8f1a36cdf87cc730477c172b90f887c3
jshoulda / History.txt
100644 109 lines (72 sloc) 3.819 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
== 1.2.1 2009-02-24
 
* New methods `useStyle` and `defineStyle`. Now for using the pair name "describe/it" all you have to do is
 
jShoulda.useStyle('describe');
 
Predefined styles are 'describe' for "describe/it" pair and 'context' or 'should' for the "context/should" pair.
 
`context` and `should` methods are still exported by default. This may change in next releases.
 
To define new styles, pass a style-name and a configuration object to `jShoulda.defineStyle`. Properties expected in the configuration are:
 
* context: an array containing names and connectors for the exportable _context_ methods
* should: an array containing names and connectors for the exportable _should_ methods
* (optional) unify: unify runners when using this style
 
Example:
 
// defining an style (better in an external shared script)
jShoulda
.defineStyle('my_custom_style', {
context: [ 'some', 'A' ],
should: [ 'does', '', 'and', '' ],
unify: true
});
 
// using it
jShoulda
.useStyle('my_custom_style');
 
 
== 1.2 2008-11-20
 
* By default, each root context creates a new Test.Unit.Runner instance, so if tests are loaded from multiple files (or the same file includes multiple root contexts), and logged to the same table, header will show incorrect data. (And worst, only one of the results would get logged by the rake task.)
 
  Now, you can use `jShoulda.unifyRunners()` to get all your tests pushed to the same runner. In addition, if you have already written tests through the "traditional" syntax, you can pass your test runner, which will be reused.
  
 
 
* The configuration object can contain properties (other than setup/teardown/before/after) which are copied to each Test.Unit in the context—that is, are accesible through `this` inside your _should_ callbacks. Best understood through example:
 
    context("A 'should' execution", {
      assertLocalYipiyay : function(input, msg) {
        this.assertEqual('yipiyay', input, msg);
      }
      },
      should("get access to extra properties defined on the configuration parameter", function() {
        this.assertLocalYipiyay('yipiyay');
      })
    )();
 
* The context aliaser is now a real generator and accepts a prefix as a second argument. So, for this testing code
 
    jShoulda
      .setContextAlias('un', 'Un')
      .setContextAlias('para', 'para')
      .setShouldAlias('deberia', 'debería');
 
    un("programador",
      para("ser feliz",
        deberia("poder comer melocotones de Calanda todo el año", function() {
        })
      )
    )();
 
  the outputted name for our test will be "Un programador para ser feliz debería poder comer melocotones de Calanda todo el año".
 
* Contexts are now allowed to be anonymous.
 
== 1.1 2008-11-09
 
* jShoulda is now a global symbol
* Refactored code to allow simple aliasing
* Aliasing methods jShoulda.setShouldAlias and jShoulda.setContextAlias
* Configurable connector deprecated (and removed) in favor of jShoulda.setShouldAlias method.
* global methods `should` and `context` are now created through aliasing
* Try this, babe
 
    jShoulda.setContextAlias('describe').setShouldAlias('it', '');
    describe("A context", {},
      it("runs tests", function() {
        this.assert(true);
      })
    )();
 
* The configuration object (setup/teardown) is now optional
* before/after are documented alias to setup/teardown since this very moment.
 
== 1.0.1 2008-10-31
 
* Configurable connector. Overwrite `should.connector` if you want to use a localized connector.
 
== 1.0 2008-10-18
 
* Version set to 1.0, no code changes
 
== 0.0.3 2008-10-11
 
* Proven to work with the original Prototype unittest.js
 
== 0.0.2 2008-10-07
 
* Now the root context invocation returns a Test.Runner instance
 
== 0.0.1 2008-10-05
 
* 1 major enhancement:
  * Initial release