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
import data_objects.drivers.DriverDefinition; | |
import java.sql.ResultSet; | |
import java.sql.SQLException; | |
import java.sql.Statement; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
import org.jruby.Ruby; | |
import org.jruby.RubyArray; | |
import org.jruby.RubyClass; | |
import org.jruby.RubyModule; |
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 | |
class Bar < Thor | |
desc "awesome", "say awesome" | |
def awesome | |
puts "Awesome" | |
end | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>My First Document</title> | |
<style type="text/css"> b { color: green; } </style> | |
</head> | |
<body> | |
<p> |
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 "a request to /foo/bar" do | |
def login | |
post("/account/login", "username=myuser&password=awesomepass") | |
end | |
def logout | |
post("/account/logout") | |
end | |
before(:each) do |
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
Merb::Router.prepare do | |
namespace :admin do | |
match("/dashboard").to(:controller => "dashboard") | |
resources :users do | |
resources :comments | |
end | |
end | |
resources :users do |
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
# Iteration 1 | |
class Foo < Application | |
def awesome | |
"Awesome" | |
end | |
end | |
match("/foo/awesome").to(:controller => Foo, :action => :awesome).name(:awesome) | |
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
$KCODE = 'UTF8' | |
require "merb-assets" | |
Merb.flat! do |url| | |
url.match('/').to(:controller => 'simple', :action =>'index') | |
end | |
class Simple < Merb::Controller | |
provides :json | |
self._template_root = Dir.pwd |
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
Spec::Matchers.create(:be_successful) do | |
matches do |rack| | |
rack.status == 200 | |
end | |
message do |not_string, rack| | |
"Expected #{describe_request(rack)}#{not_string} " \ | |
"to be successful, but it returned a #{rack.status}" | |
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
Spec::Matchers.create(:have_xpath) do | |
matches do |rack, xpath| | |
document = rack.body | |
if rack.status < 200 || rack.status >= 300 | |
@error_text = rack.body | |
false | |
else | |
@document = case document | |
when LibXML::XML::Document, LibXML::XML::Node |
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 Spec | |
module Matchers | |
def self.create(name, &block) | |
@guid ||= 0 | |
mod = Module.new do | |
klass = Class.new(MatcherDSL) do | |
def initialize(expected_value) | |
@expected_value = expected_value | |
end |