This file contains hidden or 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 'rest-client' | |
class Net::HTTP::Purge < Net::HTTPRequest | |
METHOD = 'PURGE' | |
REQUEST_HAS_BODY = false | |
RESPONSE_HAS_BODY = true | |
end | |
module RestClient | |
def self.purge(url, headers={}, &block) |
This file contains hidden or 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
#cucumber -f TestManagement::TagLogic -o /dev/null | |
module TestManagement | |
class TagLogic | |
#leave this alone... | |
def initialize(step_mother, io, options) | |
@old_tags = [] | |
end | |
#leave this alone too... |
This file contains hidden or 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
=begin | |
Copyright (c) 2011, Nathaniel Ritmeyer | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
1. Redistributions of source code must retain the above copyright notice, | |
this list of conditions and the following disclaimer. |
This file contains hidden or 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
# 1.position_suffix => "st" | |
# 2.position_suffix => "nd" | |
# 3.position_suffix => "rd" | |
# 4.position_suffix => "th" | |
# 11.position_suffix => "th" | |
# 21.position_suffix => "st" | |
# 345678.position_suffix => "th" | |
class Integer | |
def position_suffix |
This file contains hidden or 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 sl() { | |
/usr/bin/mdfind -onlyin \. $@ | |
} | |
#usage: | |
# sl Search for this phrase |
This file contains hidden or 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
Before do |scenario| | |
p scenario.source_tag_names #=> ["@complete", "@slow"] | |
end |
This file contains hidden or 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 AjaxWaiter | |
def wait_for_ajax | |
wait_until { page.evaluate_script("jQuery.active") == 0 } | |
end | |
end | |
World(AjaxWaiter) |
This file contains hidden or 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 './tinytest' | |
class MyTests < TinyTest | |
def setup | |
@name = "Bob" | |
end | |
def teardown | |
@name = "" | |
end |
This file contains hidden or 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
#you probably only need one of these, but here's the lot of them... | |
#prepare the commands that will bring the various browsers to the front | |
bring_chrome_to_front = %Q{ osascript -e "tell application \\\"Google Chrome\\\" to activate" } | |
bring_firefox_to_front = %Q{ osascript -e "tell application \\\"Firefox\\\" to activate" } | |
#execute the applescript commands to bring the browsers to the front | |
`#{bring_chrome_to_front}` | |
`#{bring_firefox_to_front}` |
This file contains hidden or 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
NOTE: I've created a gem based on this: https://github.com/natritmeyer/yarjuf | |
--------- | |
rspec my_spec.rb -r ./junit.rb -f JUnit -o results.xml |