ruby 来自https://mattbrictson.com/minitest-and-rails

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ruby 来自https://mattbrictson.com/minitest-and-rails相关的知识,希望对你有一定的参考价值。

ENV["RAILS_ENV"] ||= "test"
require File.expand_path("../../config/environment", __FILE__)
require "rails/test_help"
require "mocha/mini_test"

# Improved Minitest output (color and progress bar)
require "minitest/reporters"
Minitest::Reporters.use!(
  Minitest::Reporters::ProgressReporter.new,
  ENV,
  Minitest.backtrace_filter)

# Capybara and poltergeist integration
require "capybara/rails"
require "capybara/poltergeist"
Capybara.javascript_driver = :poltergeist

class ActiveSupport::TestCase
  fixtures :all
end

class ActionDispatch::IntegrationTest
  include Capybara::DSL
end

# See: https://gist.github.com/mperham/3049152
class ActiveRecord::Base
  mattr_accessor :shared_connection
  @@shared_connection = nil

  def self.connection
    @@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection }
  end
end
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection

以上是关于ruby 来自https://mattbrictson.com/minitest-and-rails的主要内容,如果未能解决你的问题,请参考以下文章

ruby 优化和缩小您的GIT存储库(Ruby脚本)。来自Jeff Smith @ rallydev.com。

使用来自 GitLab 的私有 gem 构建一个 Ruby 项目

ruby 来自Denys的数字任务

在 Ruby 中解析来自 Eventbrite API 的 JSON 响应

ruby 来自https://stackoverflow.com/questions/2505067/class-self-idiom-in-ruby

ruby 来自http://culttt.com/2015/07/08/working-with-mixins-in-ruby/