Skip to content

Instantly share code, notes, and snippets.

View robholland's full-sized avatar

Rob Holland robholland

View GitHub Profile
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>GreyMapper Demo</title>
<script type="text/javascript" src="mootools-1.2.1-core-yc.js"></script>
<script type="text/javascript" src="occlude.js"></script>
<script type="text/javascript" src="visibility.js"></script>
<script type="text/javascript">
# RSpec
require 'spec/expectations'
# Webrat
require 'webrat'
Webrat.configure do |config|
config.mode = :sinatra
end
World do
Scenario: Check balance amounts
Given accounts like
| name | balance |
| Current | 5 |
| Savings | 10 |
When I visit the accounts page
Then the account list should look like
| name | balance |
| Current | 5.00 |
| Savings | 10.00 |
Then /the (.*) list should look like$/ do |type, table|
columns = table.raw[0]
response.body.should have_selector("##{type}_list") { |list|
table.hashes.each_with_index do |row, index|
list.should have_selector(".#{type}") { |item|
columns.each { |column| item.should have_selector("*[text()='#{row[column]}']")}
}
end
}
end
def be_like(expected_values)
case expected_values
when Cucumber::Ast::Table
expected_values = expected_values.hashes
end
simple_matcher do |actual_values|
expected_values.each_with_index do |expected_hash, index|
unless actual_hash = actual_values[index]
# FIXME: Find a nicer way to get a useful error message
t1_setup = false
t2_setup = false
$bad = true
m = Thread.new do
begin
t = Thread.new do
begin
t2_setup = true
sleep
it "runs nested ensure clauses" do
thread = ThreadSpecs.nested_dying_thread_ensures(@method) { ScratchPad.record :in_ensure_clause }
thread.join
ScratchPad.recorded.should == :in_ensure_clause
end
def self.nested_dying_thread_ensures(kill_method_name=:kill)
o = Thread.new do
begin
t = Thread.new do
#!/usr/bin/env jruby
require 'monitor'
class WorkerToken
end
class WorkerGroup
LIMIT = 1
Complete Java stackTrace
java.lang.IllegalAccessException: Class org.jruby.internal.runtime.methods.ReflectedJavaMethod can not access a member of class org.jruby.ext.ffi.jna.JNAInvoker with modifiers "public static"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:95)
at java.lang.reflect.Method.invoke(Method.java:607)
at org.jruby.internal.runtime.methods.ReflectedJavaMethod.call(ReflectedJavaMethod.java:142)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:136)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:243)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:32)
at org.jruby.ast.CallManyArgsNode.interpret(CallManyArgsNode.java:59)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
^\Full thread dump Java HotSpot(TM) Client VM (1.5.0_16-133 mixed mode, sharing):
"Thread-2" daemon prio=5 tid=0x01032a00 nid=0x839a00 in Object.wait() [0xb130c000..0xb130cd90]
at java.lang.Object.wait(Native Method)
- waiting on <0x0d015a68> (a java.lang.Object)
at org.jruby.util.ShellLauncher$StreamPumper.run(ShellLauncher.java:742)
- locked <0x0d015a68> (a java.lang.Object)
"Thread-1" daemon prio=5 tid=0x01032850 nid=0x838c00 in Object.wait() [0xb120b000..0xb120bd90]
at java.lang.Object.wait(Native Method)