This file contains hidden or 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
| begin | |
| require 'bundler/inline' | |
| rescue LoadError => e | |
| $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
| raise e | |
| end | |
| gemfile(true) do | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' |
This file contains hidden or 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
| begin | |
| require 'bundler/inline' | |
| rescue LoadError => e | |
| $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
| raise e | |
| end | |
| gemfile(true) do | |
| source 'https://rubygems.org' | |
| gem 'rails', github: 'rails/rails' |
This file contains hidden or 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
| 1.9.3 | |
| ChildClass#f, owner: ParentClass, original_name: | |
| ParentClass#f, owner: ParentClass, original_name: | |
| ChildClass#g1, owner: GrandparentClass, original_name: | |
| ParentClass#g1, owner: GrandparentClass, original_name: | |
| ChildClass#g2, owner: ParentClass, original_name: | |
| ParentClass#g2, owner: ParentClass, original_name: | |
| 2.0.0 |
This file contains hidden or 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
| # From: http://stackoverflow.com/questions/30353272/garbage-collector-in-ruby-2-2-provokes-unexpected-cow | |
| # Modified to use rails and bundler/inline magic to load rails instead of creating a big object | |
| require 'bundler' | |
| begin | |
| require 'bundler/inline' | |
| rescue LoadError => e | |
| $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
| raise e | |
| end |
This file contains hidden or 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
| puts "Parent: #{Process.pid} #{ActiveRecord::Base.connection_pool.connections.collect(&:spid)}" | |
| SchemaMigration.count | |
| # Place I thought we'd need to disconnect | |
| # ActiveRecord::Base.clear_all_connections! | |
| puts "Parent: #{Process.pid} #{ActiveRecord::Base.connection_pool.connections.collect(&:spid)}" | |
| 10.times do | |
| pid = fork do | |
| puts "Child: #{Process.pid} #{ActiveRecord::Base.connection_pool.connections.collect(&:spid)}" |
This file contains hidden or 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
| # Fork of the rspec boom.rb: https://gist.github.com/tenderlove/183d0d7244f2f2da32aa from https://github.com/rspec/rspec-mocks/issues/1042 | |
| # This one is for minitest. | |
| # Run this with minitest/minitest-stub_any_instance, it will randomly fail in ruby 2.3.0-preview2 when the ".new" example runs last. | |
| # It passes if the stub any instance test method happens last with: | |
| # | |
| # Running | |
| # <UnboundMethod: SmallCircle(Circle)#area> | |
| # .. | |
| # | |
| # It fails with |
This file contains hidden or 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
| # Run this with rspec 2 or 3, it will randomly fail in ruby 2.3.0-preview2 when the ".new" example runs last. | |
| # It fails with | |
| # 1) SmallCircle .new | |
| # Failure/Error: | |
| # def area | |
| # super(2) | |
| # | |
| # ArgumentError: | |
| # wrong number of arguments (given 1, expected 0) | |
| # inline_spec.rb:23:in `area' |
This file contains hidden or 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
| 05:29:41 ~/Code/rspec-mocks (master) (2.3.0-preview2) + be rake spec | |
| /Users/joerafaniello/.rubies/ruby-2.3.0-preview2/bin/ruby -w -I/Users/joerafaniello/Code/rspec-core/lib:/Users/joerafaniello/Code/rspec-support/lib /Users/joerafaniello/Code/rspec-core/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb --color | |
| Run options: | |
| include {:focus=>true} | |
| exclude {:ordered_and_vague_counts_unsupported=>true} | |
| All examples were filtered out; ignoring {:focus=>true} | |
| Randomized with seed 438 | |
| ....................................................................................................................................................................................................................................................................................*...................................................................................................................................................................../Users/joerafaniello/Code/rspec-mocks/lib/rspec/mocks/method_double.rb:63: warning: metho |
This file contains hidden or 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
| # Using rails 4.2.4 from git://github.com/jrafanie/rails.git (at naively_retain_separators) | |
| # Retained String count: 27681 | |
| # Retained String memsize: 1165431 | |
| # Using rails 4.2.4 from git://github.com/rails/rails.git (at 4-2-stable) | |
| # Retained String count: 29890 | |
| # Retained String memsize: 1538153 |
This file contains hidden or 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
| # How to run: | |
| # bundle exec evm:db:reset > /dev/null && bundle exec rails r setup_ems.rb && bundle exec rails r run_refresh.rb | |
| def miq_trace(description = "") | |
| require 'allocation_tracer' | |
| ObjectSpace::AllocationTracer.setup(%i{type class}) | |
| result = ObjectSpace::AllocationTracer.trace do | |
| yield | |
| nil |