Skip to content

Instantly share code, notes, and snippets.

View halorgium's full-sized avatar

Tim Carey-Smith halorgium

View GitHub Profile
# The crutial thing here is that the work inside "run" is only done once.
# There should be no side-effects inside the examples
Spec.describe "When making a request to '/login'" do
describe "as an unauthenticated user" do
run do
@response = request("/login")
end
it "returns a 401 status" do
diff --git a/merb-core/spec/public/abstract_controller/spec_helper.rb b/merb-core/spec/public/abstract_controller/spec_helper.rb
index fd1b282..fcb6d9c 100644
--- a/merb-core/spec/public/abstract_controller/spec_helper.rb
+++ b/merb-core/spec/public/abstract_controller/spec_helper.rb
@@ -15,12 +15,9 @@ module Merb::Test::Behaviors
def dispatch_should_make_body(klass, body, action = :index, opts = {}, env = {}, &blk)
klass = Merb::Test::Fixtures::Abstract.const_get(klass)
- if opts.key?(:presets)
- controller = klass.new
# dm-core branches
1212607349 2008-06-04 14:22:29 -0500 db40b2fcba7e239f00f5056f33961fd5d389d33a origin/extlib-integration
1214517249 2008-06-26 17:54:09 -0400 a74d23f5fe892d6ff2789db4bdee31f822bbcd06 origin/visibility_api_clean_up
1215018544 2008-07-02 12:09:04 -0500 1c70f1e958374ba670dc8028e2ae4c17c6b39a5c origin/sel
1219823744 2008-08-27 09:55:44 +0200 b00eb2cbd5f18dfd2277853c38c4be6e000acff3 origin/prune
1225510008 2008-10-31 22:26:48 -0500 e5df3f6a58ae7e591f188359e33984fbccea9cfd origin/HEAD
1225510008 2008-10-31 22:26:48 -0500 e5df3f6a58ae7e591f188359e33984fbccea9cfd origin/ast
1225510008 2008-10-31 22:26:48 -0500 e5df3f6a58ae7e591f188359e33984fbccea9cfd origin/master
diff --git a/merb-action-args/lib/merb-action-args/get_args.rb b/merb-action-args/lib/merb-action-args/get_args.rb
index 7eca955..0487b76 100644
--- a/merb-action-args/lib/merb-action-args/get_args.rb
+++ b/merb-action-args/lib/merb-action-args/get_args.rb
@@ -83,7 +83,7 @@ unless RUBY_PLATFORM == "java"
klass, meth = self.to_s.split(/ /).to_a[1][0..-2].split("#")
# Remove stupidity for #<Method: Class(Object)#foo>
klass = $` if klass =~ /\(/
- ParseTreeArray.translate(Object.const_get(klass), meth).get_args
+ ParseTreeArray.translate(Object.full_const_get(klass), meth).get_args
---
publish_on_announce: false
exclude: !ruby/regexp /tmp$|CVS|\.svn|\.git|\/\._|\/\..*\.sw\w|\.gemspec/
signing_key_file: ~/.gem/gem-private_key.pem
signing_cert_file: ~/.gem/gem-public_cert.pem
blogs:
- user: user
url: url
extra_headers:
mt_convert_breaks: markdown
#define IN_ACCESS 0x00000001 /* File was accessed */
#define IN_MODIFY 0x00000002 /* File was modified */
#define IN_ATTRIB 0x00000004 /* Metadata changed */
#define IN_CLOSE_WRITE 0x00000008 /* Writtable file was closed */
#define IN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */
#define IN_OPEN 0x00000020 /* File was opened */
#define IN_MOVED_FROM 0x00000040 /* File was moved from X */
#define IN_MOVED_TO 0x00000080 /* File was moved to Y */
#define IN_CREATE 0x00000100 /* Subfile was created */
#define IN_DELETE 0x00000200 /* Subfile was deleted */
>> a = "foo"
=> "foo"
>> b = "bar"
=> "bar"
>> c = {}
=> {}
>> c[a] ||= :foo
=> :foo
>> c[b] ||= :bar
=> :bar
main = "jf*2r112r2"
f1 = "22r"
f2 = "ff*"
f1.gsub!(/2/, f2)
f2.gsub!(/1/, f1)
main.gsub!(/1/, f1)
main.gsub!(/2/, f2)
diff --git a/lib/rubygems.rb b/lib/rubygems.rb
index 458a845..bc0078f 100644
--- a/lib/rubygems.rb
+++ b/lib/rubygems.rb
@@ -121,6 +123,8 @@ module Gem
# Gem::Requirement and Gem::Version documentation.
def self.activate(gem, *version_requirements)
+ options = version_requirements.last.is_a?(Hash) ? version_requirements.pop : {}
+ sources = options[:sources] || []
describe "Without logging in" do
describe "a request to /foo/bar" do
before(:each) do
get("/foo/bar")
end
it "redirects" do
rack.status.should == 302
end