From 6b379ecfc6318e8adaeb60913caea77d0e0035d0 Mon Sep 17 00:00:00 2001 From: Simon Nielsen Date: Wed, 4 Nov 2009 00:03:03 +0100 Subject: [PATCH] gave 'given' h4 tag instead of sharing h3 with context --- riot.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/riot.js b/riot.js index dc8c729..99fae72 100644 --- a/riot.js +++ b/riot.js @@ -178,6 +178,10 @@ Riot.Formatters = { display('

' + name + '

'); }; + this.given = function(name) { + display('

' + name + '

'); + }; + this.separator = function() { display('
'); }; @@ -209,6 +213,10 @@ Riot.Formatters = { this.line(name); }; + this.given = function(name) { + this.line(name); + }; + this.separator = function() { this.line(''); }; @@ -261,7 +269,12 @@ Riot.Context.prototype = { }, run: function() { - Riot.formatter.context(this.name); + if (this.name.match(/Given/)) { + Riot.formatter.given(this.name); + } + else { + Riot.formatter.context(this.name); + } Riot.withDSL(this.callback, this)(); this.runSetup(); for (var i = 0; i < this.assertions.length; i++) {