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 'test_helper' | |
class CartsControllerTest < ActionController::TestCase | |
context "Adding a wine" do | |
context "without a quantity" do | |
setup { create_cart :wine_id => @mock_wine_id = 1 } | |
should_assign_to :wine_id | |
should_redirect_to 'wines_path' | |
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
class DslTest < Test::Unit::TestCase | |
context "The DSL" do | |
before do | |
@runner = Foundry::Runner.new | |
# Record is a simple ActiveRecord::Base class. Save its current public methods | |
# so new methods can be removed in +after+. | |
@original_record_public_methods = Record.public_methods | |
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
'/^(?:(?:(?<!^):)?[0-9A-Fa-f]{2}){6}$/' |
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() { | |
$("tr.search td") | |
.wrapInner("<div></div>") | |
.children("div") | |
.hide() | |
.closest("tr") | |
.show(); | |
$("button").click(function() { | |
$("tr.search div").slideToggle('fast'); |
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
LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-2.1.3/ext/apache2/mod_passenger.so | |
PassengerRoot /Library/Ruby/Gems/1.8/gems/passenger-2.1.3 | |
PassengerRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby | |
# | |
# This is the main Apache HTTP server configuration file. It contains the | |
# configuration directives that give the server its instructions. | |
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information. | |
# In particular, see | |
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> |
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
// I'm using AS3 like it was JS and you can't stop me. | |
_waitingQueue | |
.filter(function(obj:Object, index:int, array:Array) { | |
return obj.loader == _loader; | |
}) | |
.forEach(function(obj:Object, index:int, array:Array) { | |
_waitingQueue.splice(_waitingQueue.indexOf(obj), 1); | |
}); |
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"?> | |
<entry xmlns="http://www.w3.org/2005/Atom" | |
xmlns:media="http://search.yahoo.com/mrss/" | |
xmlns:yt="http://gdata.youtube.com/schemas/2007"> | |
<media:group> | |
<media:title type="plain">Bad Wedding Toast</media:title> | |
<media:description type="plain"> | |
I gave a bad toast at my friend's wedding. | |
</media:description> | |
<media:category |
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
class ActiveSupport::TestCase | |
# Create a be_a / be_an matchy matcher. | |
# @video.should be_a(Video) | |
# @video.should_not be_an(Octopus) | |
custom_matcher :be_a do |receiver, matcher, args| | |
expected = args[0] | |
matcher.positive_failure_message = "Expected #{ receiver.inspect } to be a #{ expected.inspect }." | |
matcher.negative_failure_message = "Expected #{ receiver.inspect } to not be a #{ expected.inspect }." |
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
#!/usr/bin/env ruby | |
html = %{This is a test | |
This is only a test | |
<pre>This is | |
some text | |
in a PRE.</pre> |
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
// Bunch of blueprint Sass imports here. | |
=flatten_list | |
:overflow hidden | |
:margin 0 | |
:list-style none | |
=hide_text | |
:text-indent -9999px |