Categories: None [Edit]

lookout

https://rubygems.org/gems/lookout
Lookout Lookout is a unit testing framework for Ruby¹ that puts your results in focus. Tests (expectations) are written as follows expect 2 do 1 + 1 end expect ArgumentError do Integer('1 + 1') end expect Array do [1, 2, 3].select{ |i| i % 2 == 0 } end expect [2, 4, 6] do [1, 2, 3].map{ |i| i * 2 } end Lookout is designed to encourage – force, even – unit testing best practices such as • Setting up only one expectation per test • Not setting expectations on non-public APIs • Test isolation This is done by • Only allowing one expectation to be set per test • Providing no (additional) way of accessing private state • Providing no setup and tear-down methods, nor a method of providing test helpers Other important points are • Putting the expected outcome of a test in focus with the steps of the calculation of the actual result only as a secondary concern • A focus on code readability by providing no mechanism for describing an expectation other than the code in the expectation itself • A unified syntax for setting up both state-based and behavior-based expectations The way Lookout works has been heavily influenced by expectations², by {Jay Fields}³. The code base was once also heavily based on expectations, based at Subversion {revision 76}⁴. A lot has happened since then and all of the work past that revision are due to {Nikolai Weibull}⁵. ¹ Ruby: http://ruby-lang.org/ ² Expectations: http://expectations.rubyforge.org/ ³ Jay Fields’s blog: http://blog.jayfields.com/ ⁴ Lookout revision 76: https://github.com/now/lookout/commit/537bedf3e5b3eb4b31c066b3266f42964ac35ebe ⁵ Nikolai Weibull’s home page: http://disu.se/ § Installation Install Lookout with % gem install lookout § Usage Lookout allows you to set expectations on an object’s state or behavior. We’ll begin by looking at state expectatio...

Total

Ranking: 32,739 of 180,534
Downloads: 33,407

Daily

Ranking: 24,048 of 180,529
Downloads: 9

Depended by

RankDownloadsName
22,15557,112inventory
34,09131,601inventory-rake
34,34431,294inventory-rake-tasks-yard
39,85125,833value
50,95718,658yard-heuristics
53,55217,439yard-value
60,92714,679lookout-rake
66,53712,951ame
67,77812,625com
78,29810,214u
98,7477,051lookout-rack
130,4584,114rbtags
131,7704,051value-yard

Depends on

RankDownloadsName
222142,522,946yard
22,15557,112inventory
34,09131,601inventory-rake
34,34431,294inventory-rake-tasks-yard
39,85125,833value
50,95718,658yard-heuristics
53,55217,439yard-value
60,92714,679lookout-rake

Owners

#GravatarHandle
1iconnow