Git Product home page Git Product logo

Comments (8)

byroot avatar byroot commented on June 17, 2024 1

Or just bin/rake. But I agree it's nice not to have to think about it.

from rails.

dorianmarie avatar dorianmarie commented on June 17, 2024

A good first step would be:

diff --git a/railties/lib/rails/api/task.rb b/railties/lib/rails/api/task.rb
index ddd7952381..da13beea4b 100644
--- a/railties/lib/rails/api/task.rb
+++ b/railties/lib/rails/api/task.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 require "rdoc/task"
-require "rails/api/generator"
+require_relative "generator"
 
 module Rails
   module API

from rails.

skipkayhil avatar skipkayhil commented on June 17, 2024

Is there a reason to not use bundle exec rake?

from rails.

dorianmarie avatar dorianmarie commented on June 17, 2024

I feel like running rake is the standard way of running tests in a ruby project

from rails.

rafaelfranca avatar rafaelfranca commented on June 17, 2024

No. Using rake you are running outside of the bundler environment. Either you need bundle exec or some bundler binstub.

from rails.

rafaelfranca avatar rafaelfranca commented on June 17, 2024

If you look on every single Ruby project, you don't see Rakefiles setting up the bundler environment, neither bundler does that when you generate a new gem. Rails apps setup the bundle environment, so I'm not opossed to do this in Rails, but definitely this isn't the standard way of running tests in Ruby projects.

Project might document rake as the way to run tests, but in reality they mean bundle exec rake. They just don't document that.

from rails.

rafaelfranca avatar rafaelfranca commented on June 17, 2024

Example https://github.com/thoughtbot/factory_bot/blob/main/CONTRIBUTING.md#running-the-test-suite

from rails.

dorianmarie avatar dorianmarie commented on June 17, 2024

Ok I'm just gonna alias rake "bundle exec rake". For thoughtbot projects I just run rspec but I have alias rspec "bundle exec rspec" because there could be multiple versions of rspec.

from rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.