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 File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper')) | |
describe DataMapper::Associations do | |
describe "#has" do | |
before do | |
class Car | |
include DataMapper::Resource | |
property :id, Serial | |
has 1, :engine |
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 File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper')) | |
describe DataMapper::Associations do | |
before do | |
class Car | |
include DataMapper::Resource | |
property :id, Serial | |
has 1, :engine | |
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
def supported_by(*adapters) | |
adapters = get_adapters(*adapters) | |
PRIMARY.only(*adapters).each do |adapter, connection_uri| | |
# keep track of the current adapters | |
AdapterHelpers.current_adapters << adapters | |
message = "with #{adapter}" if adapters.length > 1 | |
with_adapter_spec_wrapper(message) 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
share_examples_for 'An Adapter' do | |
before do | |
%w[ @adapter @resource @model @property ].each do |ivar| | |
raise "+#{ivar}+ should be defined in before block" unless instance_variable_get(ivar) | |
end | |
end | |
it "should respond to create" do | |
@adapter.should respond_to(:create) | |
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
apt_package "unzip" do | |
action :install | |
end | |
remote_file "/tmp/FreeImage.zip" do | |
source "http://downloads.sourceforge.net/freeimage/FreeImage3110.zip" | |
end | |
bash "unzip freeimage" do | |
user "root" |
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($) { | |
$.fn.video_uploader = function(options) { | |
YAHOO.widget.Uploader.SWFURL = "/uploader.swf"; | |
return this.each(function() { | |
var video_uploader_div = $(this); | |
var video_uploader = new YAHOO.widget.Uploader(uploader_ui.attr('id'), '/images/uploadButton.png'); | |
function onUploadError(event) { | |
var error_text = "There was an error with the upload: <br/>" + event.type + "<br/>" + event.status; |
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
Screw.Unit(function(){ | |
describe("Revelation.video", function() { | |
describe("display_error", function() { | |
before(function() { fixture("<div class='test_error'></div>") }); | |
it("should append an error message to a div", function(){ | |
var error_div = $('.test_error'); | |
var error_message = 'You blew up the earth!' | |
Revelation.video.display_error(error_div, error_message); |
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
it "should delete the key for the updated response" do | |
ResponsesSweeper.with_observers(:responses_sweeper) do | |
lambda do | |
post :update, update_params | |
end.should delete_cache_path("views/test.host/#{@project.site}/responses/#{@my_response.id}") | |
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
pony --version 0.3 |
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
siege -d1 -r100 -c2 --header="Cookie:_sweet_rails_session=abcdefg123456789;" https://example.com/really/crazy/action?this=is_hardcore |