Skip to content

Instantly share code, notes, and snippets.

Jan Dudek jdudek

Block or report user

Report or block jdudek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jasmine.Spy.prototype.andReturnDeferred = ->
@deferreds = []
@resolve = =>
unless @deferreds.length > 0
throw "Cannot resolve, #{@identity} was not called"
dfr = @deferreds.shift()
@reject = =>
unless @deferreds.length > 0
throw "Cannot reject, #{@identity} was not called"
jdudek / bbq_java.rb
Created Feb 8, 2012 — forked from paneq/bbq_java.rb
bbq factories
View bbq_java.rb
class Session
# some kind of delegator is needed here
# delegate everything to @session
def initialize(options)
@session =[:driver],
def kill
page.driver.quit if page.driver.browser?
jdudek / gist:1539919
Created Dec 30, 2011
Clock in JS tests
View gist:1539919
class Countdown
constructor: (@clock, @seconds) ->
$.extend(this, new Observable)
@finished = false
start: =>
fn = =>
this.trigger("updated", @seconds)
if @seconds >= 0
jdudek / gist:1485824
Created Dec 16, 2011
wait_for_server in Bbq
View gist:1485824
class TestUser
def wait(seconds)
sleep seconds.to_i
def wait_for_server(timeout = 10.seconds)
page.wait_until(timeout.to_i) do
page.evaluate_script ' == 0'
View playing_game_test.rb
require File.dirname(__FILE__) + "/../test_helper"
class PlayingGameTest < Bbq::TestCase
include Bbq::SessionPool
background do
@admin = session_pool.create_user(TestUser, :driver => :selenium)
View zad1.rb
require 'gtk2'
require 'rubygems'
require 'dbi'
class Person
DB_FILE = 'db.sqlite'
@@db = nil
@@instances = []
jdudek /
Created Nov 24, 2011
A few thoughts on testing rich-client applications (meet.js)
# A few thoughts on testing rich-client applications
# Jan Dudek, Arkency
# We've created a game that has some animations, uses Facebook API. Almost no rendering on the server. Client-server communication through JSON REST API.
test = (suite) ->
self = {}
steps = []
last = null
run = (suite, steps) ->
return if steps.length == 0
[step, msg, fn] = steps.shift()
if step == describe suite, msg, ->
jdudek / game_api_test.rb
Created Sep 13, 2011
Testing REST API using BBQ
View game_api_test.rb
require File.dirname(__FILE__) + "/../test_helper"
class GameApiTest < Bbq::TestCase
background do
@admin =
@client =
You can’t perform that action at this time.