Skip to content

Instantly share code, notes, and snippets.

View bkabrda's full-sized avatar

Slavek Kabrda bkabrda

  • Datadog
  • Czech Republic
View GitHub Profile
@bkabrda
bkabrda / gist:2875212
Created June 5, 2012 14:04
Bundler - prefer local gems
diff --git a/lib/bundler/resolver.rb b/lib/bundler/resolver.rb
index 236eedd..eb35d3d 100644
--- a/lib/bundler/resolver.rb
+++ b/lib/bundler/resolver.rb
@@ -291,6 +291,10 @@ module Bundler
end
end
+ local = matching_versions.reject { |mv| mv[0].class == Bundler::RemoteSpecification }
+ others = matching_versions - local
@bkabrda
bkabrda / pry test errors
Created May 4, 2012 06:50
pry test errors
Ruby v1.9.3 (ruby), Pry v0.9.9.4, method_source v0.7.1, CodeRay v1.0.6, Slop v3.1.1
..........................................F...........FFF.......F.FF.F.................................F.......FFFFFFFFFFFF..FF.....FF.................FF.................FFFF.FF.F.F.F....FFFFFF.F.FFFFFF...............................................F....................................................................................................................F............................................................................................................................E................................................................................................................................................................................................
Bacon::Error: 0.==(10) failed
test/test_default_commands/test_introspection.rb:33:in `block (4 levels) in <top (required)>': with FILE - should use the line number from -l
test/test_default_commands/test_introspection.rb:31:in `block (3 levels) in <top
diff --git a/spec/httparty/request_spec.rb b/spec/httparty/request_spec.rb
index 630ff3b..ad03fe1 100644
--- a/spec/httparty/request_spec.rb
+++ b/spec/httparty/request_spec.rb
@@ -223,6 +223,8 @@ describe HTTParty::Request do
http = mock("http", :null_object => true)
http.should_not_receive(:open_timeout=)
http.should_not_receive(:read_timeout=)
+ http.should_receive(:use_ssl=)
+ http.should_receive(:use_ssl?)
@bkabrda
bkabrda / gist:1845285
Created February 16, 2012 14:31
Ruby 1.9.3.p125
1) Failure:
test_dsig_algorithm_mismatch(OpenSSL::TestX509Certificate) [/builddir/build/BUILD/ruby-1.9.3-p125/test/openssl/test_x509cert.rb:175]:
OpenSSL::X509::CertificateError expected but nothing was raised.
2) Skipped:
test_s_open_no_create(TestDBM) [/builddir/build/BUILD/ruby-1.9.3-p125/test/dbm/test_dbm.rb:108]:
dbm_open() is broken on libgdbm 1.8.0 or prior
3) Skipped:
test_writer_open_notexist(TestDBM2) [/builddir/build/BUILD/ruby-1.9.3-p125/test/dbm/test_dbm.rb:532]:
@bkabrda
bkabrda / gist:1810789
Created February 12, 2012 20:49
flexmock reproducer
from flexmock import flexmock
import unittest
class A:
def x(self):
return 'a'
class B(A):
def x(self):
return 'b'
@bkabrda
bkabrda / gist:1414497
Created December 1, 2011 07:01
MKRF proposed patch
--- test/unit/test_availability.rb.orig 2011-11-30 13:58:06.206927700 +0100
+++ test/unit/test_availability.rb 2011-11-30 13:57:43.000000000 +0100
@@ -136,9 +136,17 @@
end
def test_default_include_dir_should_be_from_rbconfig
- expected = [Config::CONFIG['includedir'], Config::CONFIG["archdir"],
- Config::CONFIG['sitelibdir'], "."]
-
+ # Ruby 1.9
@bkabrda
bkabrda / gist:1357452
Created November 11, 2011 07:40
Ruby webrick tests patch
diff --git a/test/webrick/test_cgi.rb b/test/webrick/test_cgi.rb
index 1185316..0ef1b37 100644
--- a/test/webrick/test_cgi.rb
+++ b/test/webrick/test_cgi.rb
@@ -14,6 +14,7 @@ class TestWEBrickCGI < Test::Unit::TestCase
def req.meta_vars
meta = super
meta["RUBYLIB"] = $:.join(File::PATH_SEPARATOR)
+ meta[RbConfig::CONFIG['LIBPATHENV']] = ENV[RbConfig::CONFIG['LIBPATHENV']]
return meta