This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Автоматизирано (unit) тестване | |
12.04.2009 | |
== Disclaimer == | |
Днес няма да си говорим за acceptance testing, quality assurance или нещо, което се прави от "по-низшия" отдел във фирмата. Всичко тук е дело на програмиста. | |
== Митът == | |
Проектът идва с готово, подробно задание. Прави се дизайн. С него работата се разбива на малки задачи. Те се извършват последователно. За всяка от тях пишете кода и приключвате. Изискванията не се променят, нито се добавя нова функционалност. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "#overlaps?(span)" do | |
def span(lower, upper) | |
Search::Span.new(lower, upper) | |
end | |
def overlap(expected) | |
simple_matcher do |given, matcher| | |
matcher.description = "overlap with #{expected}" | |
matcher.failure_message = "expected #{given} to overlap with #{expected}" | |
matcher.negative_failure_message = "expected #{given} not to overlap with #{expected}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sunglass | |
module Slave | |
class WEBrick | |
def initialize(application, port) | |
@application = application | |
@port = port | |
@mutex = Mutex.new | |
@condition = ConditionVariable.new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class WidgetsController < ApplicationController | |
before_filter :assign_widget, :only => [:show, :new, :edit, :create:, :update, :destroy] | |
def show; end | |
def new; end | |
def edit; end | |
def create | |
if @widget.save | |
redirect_to(@widget, :notice => 'Widget was successfully created.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StrangeIntQue extends Queue[Int] { | |
override def append(x: Int) { | |
println(Math.sqrt(x)) | |
super.append(x) | |
} | |
} | |
val x: Queue[Any] = new StrangeIntQueue | |
x.append("abc") // Math.sqrt("abc") ? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val waiter = actor { | |
var result = 0.0 | |
def once(body: => Unit) = body | |
def waitForResult = react { case Result(num) => result = num } | |
def replyToEval = react { case 'Eval => reply(result) } | |
once { waitForResult } andThen { replyToEval } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package expr | |
import scala.actors.Actor | |
import scala.actors.Actor.{actor, react, reply, loopWhile, mkBody} | |
import BinOp._ | |
case class PartialResult(index: Int, num: Double) | |
class ActorEvaluation(env: Env) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val waiter = actor { | |
var result = 0.0 | |
def waitForResult = react { case Result(num) => result = num } | |
def replyToEval = react { case 'Eval => reply(result) } | |
{ waitForResult } andThen { replyToEval } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WaitForAjaxToComplete | |
def wait_for_ajax_to_complete | |
wait_until { page.evaluate_script('$.active') == 0 } | |
end | |
end | |
World(WaitForAjaxToComplete) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Day job: Software Developer @ Garmz | |
Your Rails contributions (if any): None yet | |
What's your Ruby/Rails experience?: Working with it since late 2006 | |
How do you use GitHub?: Work, private projects, university stuff |