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
diff --git a/lib/mocha/expectation.rb b/lib/mocha/expectation.rb | |
index 5dddac9..b1b0a73 100644 | |
--- a/lib/mocha/expectation.rb | |
+++ b/lib/mocha/expectation.rb | |
@@ -287,10 +287,14 @@ module Mocha # :nodoc: | |
# :call-seq: raises(exception = RuntimeError, message = nil) -> expectation | |
# | |
- # Modifies expectation so that when the expected method is called, it raises the specified +exception+ with the specified +message+. | |
+ # Modifies expectation so that when the expected method is called, it raises the specified +exception+ with the specified +message+ i.e. calls Kernel#raise(exception, 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
class Red | |
def gets(*args) | |
@input.gets(*args) | |
end | |
def puts(*args) | |
@output.puts(*args) | |
end | |
def initialize | |
@input = $stdin | |
@output = $stdout |
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
# HTML file with form including textarea | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>test</title> | |
</head> | |
<body> | |
<form action="/blah" id="wemForm" method="post"> | |
<textarea id="wem" name="wem"></textarea> |
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 have a setup method in my controller test that looks like this: | |
def setup | |
@order = Order.new | |
@order.save_new | |
session[:order_id] = @order.id | |
end | |
# I have a test that looks like this: |
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/unit" | |
require "rubygems" | |
require "mocha" | |
class Bar | |
def bar; end | |
end | |
def foo | |
timer = Timer.start(60) |
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 "rubygems" | |
require "httparty" | |
class Wem | |
include HTTParty | |
debug_output $stderr | |
ssl_ca_file '/Users/jamesmead/Sites/ssltest/demoCA/ca.crt' | |
pem File.read('/Users/jamesmead/Sites/ssltest/user/hashblue.pem') | |
base_uri "https://127.0.0.1/" | |
def self.wem |
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 'net/https' | |
url = ARGV[0] || 'www.random.org' | |
https = Net::HTTP.new(url, Net::HTTP.https_default_port) | |
https.use_ssl = true | |
https.ssl_timeout = 2 | |
https.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
https.ca_file = '/usr/share/curl/curl-ca-bundle.crt' | |
https.verify_depth = 2 | |
https.enable_post_connection_check = true |
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
127.0.0.1 - - [07/Oct/2010:16:37:05 +0100] "GET / HTTP/1.1" 200 3463 359023 | |
127.0.0.1 - - [07/Oct/2010:16:37:07 +0100] "GET / HTTP/1.1" 200 3463 523320 | |
127.0.0.1 - - [07/Oct/2010:16:37:09 +0100] "GET / HTTP/1.1" 200 3463 332680 | |
127.0.0.1 - - [07/Oct/2010:16:37:16 +0100] "GET / HTTP/1.1" 200 3463 434459 | |
127.0.0.1 - - [07/Oct/2010:16:37:20 +0100] "GET / HTTP/1.1" 200 3463 311130 | |
127.0.0.1 - - [07/Oct/2010:16:37:36 +0100] "GET / HTTP/1.1" 200 3463 688370 | |
$rate,$mean,$stdvar,$max,$min,$meanfb,$countfb |
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/unit" | |
require "rubygems" | |
require "mocha" | |
class Controller | |
def showplain(params) | |
output = nil | |
Cleaner.parse(params[:content]) do |cleaner| | |
output = cleaner.plainversion | |
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
require "test/unit" | |
require "rubygems" | |
require "shoulda" | |
require "mocha" | |
class Red | |
def gets(*args) | |
@input.gets(*args) | |
end | |
def puts(*args) |