Created
October 28, 2008 22:15
-
-
Save scudco/20536 to your computer and use it in GitHub Desktop.
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
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 |
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
--- | |
isolation: | |
:usa_url: http://www.google.com | |
:canada_url: http://www.google.ca |
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
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