Skip to content

Instantly share code, notes, and snippets.

Before do
Webrat.configure do |config|
config.mode = :rails
end
end
Before '@js' do
Webrat.configure do |config|
config.mode = :selenium
config.application_environment = :test
module ActiveRecord
# Active Record automatically timestamps create and update operations if the table has fields
# named created_at/created_on or updated_at/updated_on.
#
# Timestamping can be turned off by setting
# <tt>ActiveRecord::Base.record_timestamps = false</tt>
#
# Timestamps are in the local timezone by default but you can use UTC by setting
# <tt>ActiveRecord::Base.default_timezone = :utc</tt>
module Timestamp
function describe(description, block) {
$(document).ready(function() {
module(description);
block();
});
}
function the(what) {
return {
should : function(matcher) {

Analyzing Behavior Driven Development Root Causes

If you’re not using it already, chances are it won’t work in your team.

How it All Started?

Hi there. I am Petyo, and I am into software. Recently, ruby and rails seem to be the weapon of choice. And them rails folks love to TAFT. A while ago, trying to blend into that brave community of ‘radicals’, I decided to give webrat with selenium for unit testing, in order to mitigate the constant slippery of client-side errors the project was experiencing.

As usually, one thing leads to another. Soon cucumber was in the game, and, before you know it, purchased the beta of the rspec book, reading about the strange and sometimes awkward syntax of my new tools.

#!/usr/bin/env ruby
require 'rubygems'
require 'ruby-debug'
pid = fork do
exec("lftp -c 'sleep 100000' &> /dev/null")
end
puts "forked with #{pid}\n"
Process.detach(pid)
#!/usr/bin/env ruby
require 'rubygems'
require 'ruby-debug'
pid = fork do
$stderr.reopen(File.open("/dev/null", "w"))
exec("lftp -c 'sleep 100000'")
end
puts "forked with #{pid}\n"
get "/API/Internal/Users/:UserID/Signatures" do
content_type :json
Signature.all(:UserID => params[:UserID]).to_json
end
get "/API/Internal/Users/:UserID/Signatures/:ID" do
content_type :json
Signature.first(:UserID => params[:UserID], :ID => params[:ID]).to_json
end
Feature: sending emails through Postmark API
In order to communicate effectively with the world
My application should be able to deliver emails through the postmark API
Background:
Given the service listens to "http://postmarkapp.local"
And I have an account with api key "mykey"
Scenario: Sending simple email
Given I send the following email:
# set a big scrolling buffer
vbell off
defscrollback 10000
# Set the caption on the bottom line
caption always "%{= kw}%-w%{= BW}%n %t%{-}%+w %-= @%H - %c"
startup_message off
msgwait 2
autodetach on
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
...........................................................E.........................................................................E.......................................FFFE........................................EEEEEEEE.................................................F............................................