09 Sep '12, 12pm

Sinatra ทำ Test สวยนะฮะ

require 'hello_world' require 'test/unit' require 'rack/test' set :environment, :test class HelloWorldTest < Test::Unit::TestCase def test_it_says_hello_world browser = Rack::Test::Session.new(Rack::MockSession.new(Sinatra::Application)) browser.get '/' assert browser.last_response.ok? assert_equal 'Hello World', browser.last_response.body end def test_it_says_hello_to_a_person browser = Rack::Test::Session.new(Rack::MockSession.new(Sinatra::Application)) browser.get '/', :name => 'Simon' assert browser.last_response.body.include?('Simon') end end

Full article: http://www.sinatrarb.com/testing.html

Tweets

Google testet neues Design in der Navigation:

searchengineland.com 08 Sep '12, 3pm

Google appears to be testing out a new navigational layout, one that takes the search options that normally show in the le...

AXA puts Ferrari case to the test; outcome will...

straitstimes.com 09 Sep '12, 4am

"AXA's stand is rare and bold. The viability of its line of argument depends on the specific facts. Given the number of fa...

Prevent panic by Testing Your Factories First.

robots.thoughtbot.com 06 Sep '12, 2pm

September 6, 2012 Tagged: factories factory girl testing Comments (View) Testing Your Factories First Have you ever added ...

My VO2max Test Results: Running to Exhaustion!: This afternoon I completed my first ever VO2max test. The test i...

My VO2max Test Results: Running to Exhaustion!:...

runblogger.com 14 Sep '12, 1am

That’s the description of the test itself, so what exactly does VO2max mean? Basically, it’s a measure of how much oxygen ...

Google Testing Search Options Listed Above Resu...

searchengineland.com 08 Sep '12, 12am

Google appears to be testing out a new navigational layout, one that takes the search options that normally show in the le...

Bing Ads Testing Longer Headlines A La Google A...

searchengineland.com 10 Sep '12, 10pm

Bing Ads (the new moniker for Microsoft Advertising ) is testing an ad format that should be very familiar — they’re combi...

asserting only 1 thing in your tests helps your...

blog.jayfields.com 12 Sep '12, 5pm

I use multiple assertions per test, and here's why: 1. I'm asserting behavior, not individual lines of code. 2. I've found...