Break out testing library from ActiveSupport?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Break out testing library from ActiveSupport?

Brian Morton
I followed down the path of why my app was bringing in 'minitest' in production and noticed that activesupport has a dependency on minitest.  I wondered why it wasn't a development dependency and then it dawned on me that it was necessary for ActiveSupport::TestCase.

What does the core team think about breaking the testing-related stuff out of activesupport into a separate gem?  It would eliminate the dependency on minitest and could load (probably a trival amount) of less code for production Rails apps.  Is this a good idea and a worthwhile thing for me to spend some time on?  Is this much more work than I think it might be?

Thanks in advance!
Brian

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Break out testing library from ActiveSupport?

Rafael Mendonça França
Hi Brian,

I think to we start to consider doing this we will need a stronger reason than load less code for production Rails apps. AFAIK, we don't require active_support/test_case in production environment so we are not loading minitest at production too.

If that is the case we should fix this, but I don't think we need to extract a new library.



On Thu, Jan 9, 2014 at 5:19 PM, Brian Morton <[hidden email]> wrote:
I followed down the path of why my app was bringing in 'minitest' in production and noticed that activesupport has a dependency on minitest.  I wondered why it wasn't a development dependency and then it dawned on me that it was necessary for ActiveSupport::TestCase.

What does the core team think about breaking the testing-related stuff out of activesupport into a separate gem?  It would eliminate the dependency on minitest and could load (probably a trival amount) of less code for production Rails apps.  Is this a good idea and a worthwhile thing for me to spend some time on?  Is this much more work than I think it might be?

Thanks in advance!
Brian

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Break out testing library from ActiveSupport?

Steve Klabnik-2
In reply to this post by Brian Morton
Minitest is already in the standard library, so you're not really
adding or removing any meaningful dependence.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Break out testing library from ActiveSupport?

Jaco Pretorius
I just found this thread after noticing the same dependency today and looking for a way to potentially remove this. I don't quite see a dependency on minitest in the 'standard library' (by which I assume you mean the Rails gem itself).  https://github.com/rails/rails/blob/master/rails.gemspec  Or is there another dependency I'm missing?

As far as I can tell we would need to not autoload test_case.rb and then wrap the 'require' call to give a more meaningful error.  It's not clear to me if we expect consumers of the gem to use the ActiveSupport::TestCase class, or is that purely for testing the library itself?  I don't see any explicit examples for it in the documentation, but I'm also not that familiar with MiniTest.

On Thursday, January 9, 2014 at 4:08:34 PM UTC-5, Steve Klabnik wrote:
Minitest is already in the standard library, so you're not really
adding or removing any meaningful dependence.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Break out testing library from ActiveSupport?

Matt Jones-15

On Jul 25, 2017, at 4:00 PM, Jaco Pretorius <[hidden email]> wrote:

On Thursday, January 9, 2014 at 4:08:34 PM UTC-5, Steve Klabnik wrote:
Minitest is already in the standard library, so you're not really 
adding or removing any meaningful dependence. 

I just found this thread after noticing the same dependency today and looking for a way to potentially remove this. I don't quite see a dependency on minitest in the 'standard library' (by which I assume you mean the Rails gem itself).  https://github.com/rails/rails/blob/master/rails.gemspec  Or is there another dependency I'm missing?


When Steve wrote that sentence three+ years ago, minitest was still included as part of the Ruby standard library. It was removed in 2.2 - see this discussion for more details:


As far as I can tell we would need to not autoload test_case.rb and then wrap the 'require' call to give a more meaningful error.  It's not clear to me if we expect consumers of the gem to use the ActiveSupport::TestCase class, or is that purely for testing the library itself?  I don't see any explicit examples for it in the documentation, but I'm also not that familiar with MiniTest.

ActiveSupport::TestCase can be used directly (see the example in the guides: http://guides.rubyonrails.org/testing.html#rails-meets-minitest ). The minitest plumbing is also used by Rspec (in at least some cases):


I’ll reiterate Rafael’s point from earlier in the thread: why is removing this dependency important?

—Matt Jones

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.
Loading...