Skip to content

Instantly share code, notes, and snippets.

@scudco
Created October 28, 2008 22:15
Show Gist options
  • Save scudco/20536 to your computer and use it in GitHub Desktop.
Save scudco/20536 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'taza'
class Google < Taza::Site
def initialize(brand)
brand_url = Google.settings["#{brand}_url".to_sym]
super(:url => brand_url)
end
end
module Spec::Example::ExampleGroupMethods
def all_brands(description, &block)
[:usa,:canada].each do |brand|
new_block = Proc.new { block.call(brand) }
it("#{brand} -- #{description}",&new_block)
end
end
end
---
isolation:
:usa_url: http://www.google.com
:canada_url: http://www.google.ca
require 'spec/spec_helper'
require 'google'
describe "HomePage" do
all_brands "should fail because you haven't written any tests yet" do |brand|
Google.new(brand) do |google|
puts "Hey guys I'm at this url: #{google.browser.url}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment