GithubHelp home page GithubHelp logo

Comments (5)

grosser avatar grosser commented on July 19, 2024

first I'd say go pick another testing tool, autotest is pretty old and pretty bad,

I think you might be able to just do a self.sleep = 0 in your .autotest, since the extensions are loaded in the autotest object
https://github.com/grosser/autotest/blob/master/lib/autotest.rb#L307

from autotest.

squarism avatar squarism commented on July 19, 2024

I usually use guard but one project I'm on uses Minitest which won't work with spork and guard. Autotest works and the above fix does work. self.sleep=0 doesn't work within the reopened .autotest class nor outside it.

I'll just post my .autotest file in case it helps someone. It works, I just hate how hacky it is. I wish I could get to the instance of autotest better or catch the init in a Rails initializer?

require 'autotest/fsevent'

class Autotest
  # does not work
  # self.sleep = 0

  # run tests over drb server (spork)
  def make_test_cmd files_to_test
    if files_to_test.empty?
      "" # no tests to run
    else
      "testdrb #{files_to_test.keys.join(' ')}"
    end
  end
end

# tighten up the time before the test is run
ObjectSpace.each_object(Autotest).first.sleep = 0

# does not work
#self.sleep = 0

from autotest.

grosser avatar grosser commented on July 19, 2024

Looks like load has no access to the current scope (not event instance vars)
it's a weird spot since autotest is already initialized + you do not get access to the instance.
A way would be to have Autotest.sleep and when sleeping do sleep sleep || self.class.sleep so you could overwrite it.
I'd merge a pull for this if you care enough to build it :)

from autotest.

squarism avatar squarism commented on July 19, 2024

I'll work on it then. :)

Issue #34 pull request opened for this.

from autotest.

squarism avatar squarism commented on July 19, 2024

❤️

from autotest.

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.