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 "capybara" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
sess = Capybara::Session.new(:selenium, app) | |
sess.visit("/") | |
sess.click_link("Click me") | |
sess.reset! |
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
source "http://rubygems.org" | |
ruby "2.3.0" | |
gem "selenium-webdriver" | |
gem "capybara", "2.7.0" |
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
# Prevents requests from hitting the Rails app after the test has finished. | |
class CapybaraRequestBlockerMiddleware | |
# assignment to initialized instance variables is thread safe in Ruby | |
@enabled = false | |
class << self | |
def enabled? | |
@enabled | |
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
Compiling graphers v0.1.0 (file:///Users/jonasnicklas/Projects/graphers) | |
src/parse/grammar.rs:390:13: 390:60 error: unreachable pattern [E0001] | |
src/parse/grammar.rs:390 Some((__loc1, Tok::Identifier(__tok0), __loc2)) => { | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
src/parse/grammar.rs:390:13: 390:60 help: run `rustc --explain E0001` to see a detailed explanation | |
src/parse/grammar.rs:438:13: 438:60 error: unreachable pattern [E0001] | |
src/parse/grammar.rs:438 Some((__loc1, Tok::Identifier(__tok0), __loc2)) => { | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
src/parse/grammar.rs:438:13: 438:60 help: run `rustc --explain E0001` to see a detailed explanation | |
src/parse/grammar.rs:481:13: 481:45 error: unreachable pattern [E0001] |
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
<!doctype html> | |
<html> | |
<body> | |
<ul> | |
</ul> | |
<script> | |
(function() { | |
var a = 10, b = 20; |
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
12:56:53,438 ERROR [org.jgroups.protocols.MERGE3] (OOB-1,shared=udp) failed passing message up: java.lang.NullPointerException | |
at java.util.concurrent.ConcurrentSkipListMap.comparable(ConcurrentSkipListMap.java:645) [rt.jar:1.6.0_24] | |
at java.util.concurrent.ConcurrentSkipListMap.doPut(ConcurrentSkipListMap.java:890) [rt.jar:1.6.0_24] | |
at java.util.concurrent.ConcurrentSkipListMap.putIfAbsent(ConcurrentSkipListMap.java:1921) [rt.jar:1.6.0_24] | |
at java.util.concurrent.ConcurrentSkipListSet.add(ConcurrentSkipListSet.java:230) [rt.jar:1.6.0_24] | |
at org.jgroups.protocols.MERGE3.up(MERGE3.java:270) | |
at org.jgroups.stack.Protocol.up(Protocol.java:398) | |
at org.jgroups.stack.Protocol.up(Protocol.java:406) | |
at org.jgroups.stack.Protocol.up(Protocol.java:406) | |
at org.jgroups.protocols.TP.passBatchUp(TP.java:1383) |
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
~/Projects/celluloid(master)$ ruby -v | |
jruby 1.7.4 (1.9.3p392) 2013-09-10 fffffff on Java HotSpot(TM) 64-Bit Server VM 1.6.0_51-b11-457-11M4509 [darwin-x86_64] | |
~/Projects/celluloid(master)$ ruby -Ilib test.rb | |
E, [2013-10-08T09:29:58.009000 #7130] ERROR -- : Actor crashed! | |
RuntimeError: foo | |
test.rb:6:in `crash' | |
org/jruby/RubyKernel.java:1932:in `public_send' | |
/Users/jonasnicklas/Projects/celluloid/lib/celluloid/calls.rb:26:in `dispatch' | |
/Users/jonasnicklas/Projects/celluloid/lib/celluloid/calls.rb:122:in `dispatch' | |
/Users/jonasnicklas/Projects/celluloid/lib/celluloid/cell.rb:60:in `invoke' |
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 "capybara" | |
require "active_record" | |
ActiveRecord::Base.establish_connection :adapter => "postgresql", :host => "127.0.0.1", :database => "pool-test", :username => "elabs", :pool => 1 | |
class User < ActiveRecord::Base; end | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html % User.first.try(:name)] ] } |
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 get(prop) { | |
return function(object) { | |
return object[prop]; | |
}; | |
}; | |
function call(prop) { | |
var args = Array.prototype.slice.call(arguments, 1); | |
return function(object) { | |
return object[prop].apply(object, args); |
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 "capybara" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
sess = Capybara::Session.new(:selenium, app) | |
sess.visit("/") | |
__END__ | |