Skip to content

Instantly share code, notes, and snippets.

### trying to merge trunk -> project
Conflict adding files to features. Created directory.
Conflict because features is not versioned, but has versioned children. Versioned directory.
Conflict adding file features. Moved existing file to features.moved.
Conflict adding files to features/either. Created directory.
Conflict because features/either is not versioned, but has versioned children. Versioned directory.
Conflict adding files to features/step_definitions. Created directory.
Conflict because features/step_definitions is not versioned, but has versioned children. Versioned directory.
Contents conflict in features/step_definitions/user_steps.rb
$ ruby --version
ruby 1.8.6 (2008-08-11 patchlevel 287) [i686-linux]
$ irb
irb(main):001:0> require 'date'
=> true
irb(main):002:0> Date.civil_to_jd(2004,10,20)
=> 248812494
irb(main):003:0> Date.jd_to_civil(Date.civil_to_jd(2004,10,20))
=> [2096, -1, 5731]
## Loosen webrat's field label matching regexp
module Webrat
module Locators
class FieldLabeledLocator < Locator
def matching_label_elements_with_numbering
label_elements.select do |label_element|
text(label_element) =~ /^.*#{Regexp.escape(@value.to_s)}.*$/i
end
end
require 'spec/runner/formatter/specdoc_formatter'
class FindEvilExamplesFormatter < Spec::Runner::Formatter::SpecdocFormatter
def example_failed(*args)
warn_if_users_still_exist
super
end
def example_passed(*args)
warn_if_users_still_exist
"""Run a command before allowing a commit."""
import sys
import os
import re
import pprint
from bzrlib import (
branch,
errors,
Date: Thu, 3 Sep 2009 11:55:42 -0500
From: David Chelimsky <contact@eventbrite.com>
To: "Hinze, Paul T" <paul-hinze@uiowa.edu>
Subject: WindyCityRails 2009 - PM Tutorial Information
Reply-To: "dchelimsky@gmail.com" <dchelimsky@gmail.com>
Thanks for registering for Behaviour Driven Rails with RSpec and Cucumber, the PM tutorial at WindyCityRails 2009! This tutorial will begin immediately following lunch, running from 1:00pm to 3:45pm.
This is a hands on, skills development workshop, so please bring your laptops and be ready to write some code. While attendees are not expected to be experts with any of these tools and techniques, you are expected to have at least a basic working knowledge of Ruby, Ruby on Rails, RSpec, and Cucumber.
## app/models/person.rb
class Person < ActiveRecord::Base
has_many :pets
end
## app/models/pet.rb
class Pet < ActiveRecord::Base
belongs_to :person
it "should work with textareas and new lines" do
with_html <<-HTML
<html>
<form method="post" action="/login">
<label for="user_text">User Text</label>
<textarea id="user_text" name="user[text]"></textarea>
<input type="submit" />
</form>
</html>
HTML
spec_acts_as_plugin(:acts_as_billable) do |plugin|
plugin.should require_methods(
:billable_amount,
:billable_description,
:billable_type,
:billable_user,
:billable_mfk
)
plugin.should define_methods(
class Version
named_scope :as_of, lambda { |a_certain_time|
effkay = original_class.versioned_foreign_key
{ :conditions => [
"#{table_name}.version = (
SELECT MAX(vtn.version)
FROM #{table_name} AS vtn
WHERE vtn.#{effkay} = #{table_name}.#{effkay}
AND vtn.updated_at <= ?
)", a_certain_time.to_s(:db) ] }