Skip to content

Instantly share code, notes, and snippets.

View jbpros's full-sized avatar
🖐️
yo

Julien Biezemans jbpros

🖐️
yo
View GitHub Profile
@jbpros
jbpros / ERROR
Created September 21, 2012 21:58 — forked from Pitbi/ERROR
DEBUG: TypeError: Cannot read property 'value' of undefined
at _asyncMap (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:185:23)
at async.forEachSeries.iterate (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:108:13)
at async.forEachSeries.iterate (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:119:25)
at _asyncMap (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:187:17)
at async.series.results (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:491:34)
at async.forEach (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:94:25)
at bestLapSearch (/home/pitbi/Projects/RaceLive/lib/rfactor_xml_parser.js:188:19)
at async.forEach (/home/pitbi/Projects/RaceLive/node_modules/async/lib/async.js:86:13)
at Array.forEach (native)
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var qualificationSchema = new mongoose.Schema ({
date : Date,
track : {type: Schema.ObjectId, ref : 'Track'},
mod : {type: Schema.ObjectId, ref : 'Mod'},
entrys : [entrySchema]
});
var Qualification = mongoose.model('Qualification', qualificationSchema);
server.get('/parseXML2', function (req, res) {
fs.readFile('./export/2012_09_13_22_14_10-63Q1.xml', function (err, file) {
var xml = libxmljs.parseXml(file);
var date = xml.get("/rFactorXML/RaceResults/TimeString").text();
var track = xml.get("/rFactorXML/RaceResults/TrackEvent").text();
var trackLength = xml.get("/rFactorXML/RaceResults/TrackLength").text();
var mod = xml.get("/rFactorXML/RaceResults/Mod").text();
var drivers = xml.find("//Driver");
Track.findOne({name: track}).exec(function (err, existingTrack) {
{
"author": "Julien Biezemans <...> (http://jbpros.net)",
"name": "cukecipes",
"description": "Example Node.js application demonstrating Cucumber.js usages",
"version": "0.0.0-12",
"repository": {
"url": ""
},
"main": "server.js",
"scripts": {
jbpros@arwen:~/Projects/cucumber-js ‣ cucumber.js -f pretty
Feature: Asynchronous failing steps
Scenario: see asynchronously failing scenarios
Given the following feature:
And the step "I divide 10 by 0" has a mapping asynchronously failing with the message "Divide by 0, uh?"
When Cucumber runs the feature
Then the scenario called "a failing scenario" is reported as failing
Scenario: see asynchronously failing scenarios with exception
Feature: relish emphasis on step placeholders
Plain old scenario steps can't contain "placeholders". Strings matching the placeholder syntax applicable to scenario outlines steps should not be recognised in "normal steps".
@passing
Scenario: scenario outline step placeholder
Given the following feature fragment:
"""
Scenario Outline:
Given <blah>
@jbpros
jbpros / gist:3172824
Created July 24, 2012 21:34
Failing Cucumber.js build
jbpros@arwen:~/Projects/cucumber-js ‣ rake
cucumber -p quiet
Using the quiet profile...
U...........................................................................................................................................................................................................................................................UU--UU--UU--UU---UU---UU---UU---UU---UU---UU---UU-----UU-----UU---UU---UU---UU---UU---UU---UU---UU---UUUUUUUUUUUUUUUUUUUUUUUUUUUU.........................
91 scenarios (27 undefined, 64 passed)
405 steps (61 skipped, 68 undefined, 276 passed)
0m13.532s
npm test
class World
# ...
commandRemote: (commandName, data, callback) ->
postData = querystring.stringify payload
options =
host: @host,
port: @port,
path: "#{@path}/#{commandName}",
method: 'PUT'
class Blah
@singleton: ->
@_singleton ?= new @
"en":
name: English
native: English
feature: Feature
background: Background
scenario: Scenario
scenario_outline: Scenario Outline|Scenario Template
examples: Examples|Scenarios
given: "*|Given"
when: "*|When"