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
# Soon to be gemified | |
# http://github.com/scudco/horrible | |
require 'rubygems' | |
require 'spec' | |
require 'highline/import' | |
module Moonit | |
module Spec | |
def step(description,&block) |
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
CmdUtils.makeBookmarkletCommand({ | |
name: "Note in Reader", | |
url:"javascript:var%20b=document.body;var%20GR________bookmarklet_domain='http://www.google.com';if(b&&!document.xmlVersion){void(z=document.createElement('script'));void(z.src='http://www.google.com/reader/ui/link-bookmarklet.js');void(b.appendChild(z));}else{}" | |
}) |
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 | |
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 ForwardInitialization | |
module ClassMethods | |
def new(*args,&block) | |
# name in this case is very different from self.class.to_s | |
const_get("#{name.split("::").last}").new(*args,&block) | |
end | |
end | |
def self.included(klass) | |
klass.extend(ClassMethods) |
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 "Foo" do | |
it "should pass" do | |
true.should be_true | |
end | |
it "should also pass" do | |
true.should be_false | |
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
describe "ShoppingCartPage" do | |
it "should update the shipping charges if a premium shipping option is selected" do | |
MyWidgetStore.new do |widget_store| | |
widget_store.shopping_cart_page do |cart| | |
initial_shipping_charges = cart.shipping_charges | |
cart.shipping_option.select "Super Same Day Shipping 5000" | |
cart.shipping_charges.should_not == initial_shipping_charges | |
cart.shipping_charges.should == '$75.00' | |
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
# this could be in a folder with other modules 'lib/sites/ecom/pages/checkout/' | |
module Ecom | |
class CheckoutPage < ::Taza::Site | |
filter :billing_ready?, :billing | |
page_module :billing do | |
element(:first_name) { browser.text_field(:id => 'billing_first_name') } | |
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
module Foo | |
const_set "Some", Module.new do | |
module Boo;end | |
end | |
end | |
puts Foo::Some # => Foo::Some | |
puts Foo::Some::Boo # => foo.rb:9: uninitialized constant Foo::Some::Boo (NameError) |
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 Foo | |
define_method("foo bar baz") do | |
p "lol methods with spaces m i rite?" | |
end | |
end | |
Foo.new.send("foo bar baz") |
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
function! Ack(args) | |
let grepprg_bak=&grepprg | |
set grepprg=ack\ -H\ --nocolor\ --nogroup | |
execute "silent! grep " . a:args | |
botright copen | |
let &grepprg=grepprg_bak | |
endfunction | |
command! -nargs=* -complete=file Ack call Ack(<q-args>) |
OlderNewer