now / lookout Goto Github PK
View Code? Open in Web Editor NEWLookout is a unit testing framework for Ruby that puts your results in focus
Home Page: http://disu.se/software/lookout-3.0/
License: Other
Lookout is a unit testing framework for Ruby that puts your results in focus
Home Page: http://disu.se/software/lookout-3.0/
License: Other
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.
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
Should keep track of how long expectations run for so that we can output statistics about slow tests.
Delegation support seems like it won’t be used very much, so remove it, unless we find a good use for it.
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).
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.
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.