A look at some of the processes and tools of the trade employed by modern day javascript developers, for performance, testing, and application development.
on the web As a webmaster I want to have a homepage Scenario: View Homepage Given I am on the Homepage When I click "Greet!" Then I should see "Hello World!"
brain to mush As a troll I want to write programs in brainfuck Scenario: Hello World Given I enter the code: """ >+++++++++[<++++++++>-]<. >+++++++[<++++>-]<+. +++++++..+++. >>>++++++++[<++++>-]<. >>>++++++++++[<+++++++++>-]<---. <<<<.+++.------.--------.>>+. """ When I run the program Then I should see "Hello World!" as the result
{ this.Given('I enter the code:', function(code, callback) { this.code = code; callback(); }); this.When('I run the program', function(callback) { this.result = brainfuck(this.code); callback(); }); this.Then('I should see "$result" as the result', function(result, callback) { if (this.result !== result) { callback.fail(new Error('Expected "'+result+'" but received "'+this.result+'"')); } else { callback(); } }); };
to convert string path expressions into regular expressions used in the matching stage of request delegation. Simple Parser ============= .. class:: delegator.parser.SimpleParser(patterns) Parser to turn path expressions into regular expressions with a list of group names. .. function:: parser.parse(pattern) Parse a string into a regular expression :param pattern string: the pattern string to parse :throws delegator.errors.ParserError: For invalid patterns. :returns: A dictionary containing the regular expression and an array of keys