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 'nokogiri' | |
RSpec::Matchers.define :have_xpath do |*paths| | |
match do |doc| | |
!doc.xpath(*paths).empty? | |
end | |
end | |
def within *paths, &block | |
describe "within #{paths.inspect}" do |
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
class Cucumber::Ast::StepInvocation | |
def failed(configuration, e, clear_backtrace) | |
if Cucumber::JRUBY && e.class.name == 'NativeException' | |
# JRuby's NativeException ignores #set_backtrace. | |
# We're fixing it. | |
e.instance_eval do | |
def set_backtrace(backtrace) | |
@backtrace = backtrace | |
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
repositories { | |
ivy { | |
ivyPattern "http://repository.gemjars.org/ivys/[organisation]/ivy-[module]-[revision].xml" | |
artifactPattern "http://repository.gemjars.org/jars/[organisation]/[module]-[revision].jar" | |
} | |
} | |
configurations { | |
rspec.extendsFrom runtime | |
} |
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
POST /session HTTP/1.1 | |
GET /session/ad69c299769a6a219f10173073210387 HTTP/1.1 | |
POST /session/ad69c299769a6a219f10173073210387/element/:wdc:1344363770883/elements HTTP/1.1 | |
POST /session/ad69c299769a6a219f10173073210387/elements HTTP/1.1 | |
GET /session/ad69c299769a6a219f10173073210387/element/:wdc:1344363775379/displayed HTTP/1.1 | |
POST /session/ad69c299769a6a219f10173073210387/elements HTTP/1.1 | |
GET /session/ad69c299769a6a219f10173073210387/element/:wdc:1344363775380/displayed HTTP/1.1 | |
POST /session/ad69c299769a6a219f10173073210387/element/:wdc:1344363775380/elements HTTP/1.1 | |
GET /session/ad69c299769a6a219f10173073210387/element/:wdc:1344363775381/displayed HTTP/1.1 | |
GET /session/ad69c299769a6a219f10173073210387/element/:wdc:1344363775381/selected HTTP/1.1 |
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
YAML.add_builtin_type('yes_no') {|type, value| value == 'Y'} | |
YAML.load("blah: !yes_no 'Y'") == {'blah' => true} |
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
import math | |
class Calculator: | |
def plus(self, first, second): | |
return first + second | |
def pi(self): | |
return math.pi |
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
class Blah | |
def to_ary | |
[1, 2, 3] | |
end | |
end | |
blah = Blah.new | |
one, two, three = blah |
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
class Foo | |
def self.with_bar | |
Foo.new(Bar.new) | |
end | |
def initiatize bar | |
@bar = bar | |
end | |
def something_fun |
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
package com.example.pry; | |
import org.jruby.embed.ScriptingContainer; | |
public class Main { | |
public static void main(String... args){ | |
ScriptingContainer container = new ScriptingContainer(); | |
container.runScriptlet("require 'pry'; binding.pry"); | |
} | |
} |
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
var falafel = require('falafel'); | |
var fs = require('fs'); | |
var file = process.argv[2]; | |
var src = fs.readFileSync(file).toString(); | |
var output = falafel(src, {loc: true}, function (node) { | |
if (node.type === 'Identifier' && node.name === "it") { | |
var testBody = node.parent.arguments[1].body.body | |
var lastStatement = testBody[testBody.length - 1]; |