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
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.
View zad1.rb
require 'gtk2'
require 'rubygems'
require 'dbi'
class Person
DB_FILE = 'db.sqlite'
@@db = nil
@@instances = []
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)
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'
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 / 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?
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 / gist:2136360
Created Mar 20, 2012
Jasmine: suite [] instead of nested describe
View gist:2136360
# suite ["shooter", "acceptance"], -> ...
# is equivalent to:
# describe "shooter", ->
# describe "acceptance", -> ...
window.suite = (names, block) ->
name = names.shift()
if names.length > 0
describe(name, -> suite(names, block))
View avl.c
#include <stdio.h>
#include <stdlib.h>
#define AVL_AS_LIST
typedef int AvlKey;
struct AvlNode {
AvlKey key;
char balance;
You can’t perform that action at this time.