Git Product home page Git Product logo

lookout's People

Contributors

holgerk avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lookout's Issues

Be more restrictive in output

Output is slow, as we have to flush it. It would be better to not report progress unless things are going slowly (if then, even). I think that reporting the progress as a percentage makes more sense as well, as those dots really don’t say a whole hell of a lot. This also makes it easier to see what happened, as the interesting output (failures and errors) would be the only output, if any.

Rework Lookout::Expectations to not store expectations

Lookout::Expectations currently stores expectations as they are defined to later run them when requested to do so. This is completely unnecessary and I can think of no UI that would desire such behavior. Instead, load the interface as soon as this object is created, then, whenever #expect is called, run the expectation and report and store the result. (The storing of results is also questionable, as this is probably better served by a UI that decides to use Lookout::Results to summarize the results, if necessary. For example, Lookout::UI::Console currently only cares about failures and errors, so no need to store result objects for successes.)

This rewrite also saves us from using at_exit, which is something that I consider to be a worthy cause.

Anyway, for the normalization tests of U, the adjustment below saves us about a gigabyte worth of memory.

class Lookout::Expectations
  undef expect
  def expect(expected, &block)
    @results ||= Lookout::Results.new
    unless defined? @ui
      @ui = Lookout::UI::Console.new
      @ui.start
    end
    file, line = /\A(.*):(\d+)(?::in .*)?\z/.match(caller.first)[1..2]
    @results << Lookout::Expectation.on(expected, file, line, &block).evaluate.tap{ |result| @ui.report result }
    expected
  end

  undef evaluate
  def evaluate(ui = lookout::ui::console.new, results = lookout::results.new)
    @ui.summarize @results, 0
    @results
  end

  undef each
  def each(line = nil)
    self
  end
end

Remove delegation support

Delegation support seems like it won’t be used very much, so remove it, unless we find a good use for it.

Don’t use at_exit

The whole runner architecture should be redone. The rake loader should simply create an object that manages the state, loads all the files, then asks the runner to finalize the test run (doing what is currently done in the at_exit hook).

Replace Mocha dependency

Mocha is a rather large library and contains a lot of things that we don’t need. Writing our own mocking framework would also be a good lesson.

Expect exactly

It should be possible to expect an exact object:

expect exactly(/abc/) do
  /abc/
end

should pass while

expect exactly(/abc/) do
  'abc'
end

should not.

Diff should be a method on literals

Having diff as a utility method is stupid. It would be better to add a literal for Strings that could have the diff method instead. Literals of StandardErrors could apply the diff to the messages.

Diff objects on instance variables

One way to display diffs on random objects is to diff the instance variables like they were a hash (which they more or less are). The question is if we should be diffing the instance variables’ values as well.

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.