タグ

関連タグで絞り込む (2)

タグの絞り込みを解除

testとsinatraに関するmanabouのブックマーク (2)

  • sinatraでテストの入門の入門(その1) - tomiの日記

    「sinatraすげー」って今さら思い、sinatraで何か作ってみようかねーと思い、当然テストのことが気になりました。 そもそも「テスト出来るの?実はrailsと比べて大変じゃないの???」って感じのアホな不安でした。(1週間前までsinatraのことと言えば名前しかしらなかったので。。)テストについてはちゃんと公式ページで解説されています。rspecも使えます。capybaraも使えます。他のテストフレームワークも使えるようです。 参考ページは Testing Sinatra with Rack::Test です。ここの内容を理解していきます。 サンプルコード テスト対象のコード。いつものhello world。 require 'sinatra' get '/' do "Hello World #{params[:name]}".strip end テストコード require '.

    sinatraでテストの入門の入門(その1) - tomiの日記
  • Testing Sinatra with Rack::Test

    Testing Sinatra with Rack::Test All examples in the following sections assume that Test::Unit is being used in an attempt to be as general as possible. See the Test Framework Examples for information on using the test helpers in other testing environments. To use the Rack::Test library used when you require rack/test, you’ll need to install the rack-test gem:

  • 1