You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
はじめに ソフトウェアを作るときには同時にテストも作ります。 テストを動かすことで、ソフトウェアが設計の通り動作しているかを確認できます。もし設計の通りに動作しない場合はテストが失敗し、ソフトウェアに期待する動作と現在の間違った動作が明確になります。 テストをすっきりと書くことができると、テストを読みやすくなり、また、きれいなソースコードのままで新しくテストを追加することができます。 今回は、そのすっきりとテストを書くための方法について説明します。 テストを追加していくと発生する問題 例えば、1つのテストケースの中にいろいろな機能のテストがある場合を考えます。 ここで、ある機能の実装を修正したので、この機能に関するテストを追加しようとしました。 テスト名に「テストのコンテキスト」と「テスト対象」を含めてどのような内容のテストかを示します。 このとき、ある機能に対して様々な動作をテストするこ
= Ruby DocTest Official repository: * http://github.com/tablatom/rubydoctest Wiki documentation: * http://github.com/tablatom/rubydoctest/wikis == Description: Ruby version of Python's doctest tool, but a bit different. Ruby DocTest allows you to: 1. Write tests in irb format and keep them as comments next to your Ruby code. 2. Write markdown documents with irb format tests embedded in them. == Sy
このウェブサイトは販売用です! twiwt.org は、あなたがお探しの情報の全ての最新かつ最適なソースです。一般トピックからここから検索できる内容は、twiwt.orgが全てとなります。あなたがお探しの内容が見つかることを願っています!
rcovを使ってて、いちいちHTMLを見ないといけないのが面倒と思ってる人は、是非とも「--gcc」オプションを使ってみよう。 いちいちHTML見るのめんどくせえと思ってずっと前に俺が追加したオプションだが、あまり知られてないようだ。 # a.rb def foo(x) if x >= 3 x+2 else x+1 end end require 'test/unit' class TestFoo < Test::Unit::TestCase def test_1 assert_equal(12, foo(10)) end end テスト漏れの部分が標準出力に出力される。 これでエディタの中で快適にジャンプできるだろう。 $ rcov --gcc /tmp/a.rb Loaded suite /usr/local/bin/rcov Started . Finished in 0.00071
Releases, Offers & More Be the first to hear about our newest content, best promotions and upcoming events. Plus get 25% off your next purchase. Newsletter Sign Up Download Accounts Your email address is your account identifier. You can create a password, or just download from the links sent via email. My Orders (Resend order emails) How We're Different Hands-on instructions Solutions to real-worl
Code coverage for Ruby Source Code API documentation Changelog Rubygem Continuous Integration SimpleCov is a code coverage analysis tool for Ruby. It uses Ruby's built-in Coverage library to gather code coverage data, but makes processing its results much easier by providing a clean API to filter, group, merge, format, and display those results, giving you a complete code coverage suite that can b
はじめに Web APIを使って様々なサービスと連携するというアーキテクチャはすっかり定着した感があります。みなさんも、Web APIを使ってデータをやりとりするアプリケーションを書く機会も増えているのではないでしょうか。 Web APIを使うアプリケーションの開発では、テストやデバッグをする際のAPIアクセスが悩みどころとなります。本物のサーバを使ったのではテストデータの初期化などに手間がかかりますし、逆にHTTPアクセス自体をスタブやモックを使って間接化してしまうとそれが本当に有効なテストなのか不安が残ってしまいます。 筆者も、仕事やプライベートでのコーディングでこのような悩みに何度も遭遇しました。これらを解決するために開発したのがwwです(wwと書いて'double-web'と読みます)。 ダミーWebサーバ作成ライブラリww(Double Web) wwは、Webサービスの簡単
近頃はWebAPIを使ったアプリケーションを作ることが増えていると思いますが、自動化テストからのWebAPIへのアクセスはどうやってますか? 私は、自分でstubしたりFakeWeb(レシピ先輩に教わった!!)を使ったりしてたんですが、イマイチしっくりこない部分がありました。で、Sinatraなぞで作ってたんですが、それをgemにまとめましたので、よろしければご利用ください。 http://github.com/moro/ww http://gemcutter.org/gems/ww 概要 ww(Double Web)はいわゆるDouble(mock, stub, spyなど)の機能を備えたダミーWebサーバを簡単に作るためのフレームワーク(笑)です。現状では、以下のようなことが出来ます。 他のAPIサーバを使う場合などに、簡単にダミーサーバを作る そのダミーサーバは自動化テストないから起
Watching: 1800 gems with 45 users contributing 44 platforms under 768 projects and 20405 results since Jan 31, 2007 Firebrigade tests every gem ever made on every platform under the sun and summarizes the results, enabling developers to see how their packages perform on systems they don't have access to.
tinderbox version 1.0.0 has been released! Eric Hodel | Wed, 31 Jan 2007 09:24:00 GMT Posted in Rubygems, Seattle.rb, Software, Testing tinderbox version 1.0.0 has been released! http://seattlerb.rubyforge.org/tinderbox Description Tinderbox tests projects and tries to make them break by running them on as many different platforms as possible. Features & Problems Tests gems in a sandbox Submits ge
Classes in Python allow developers to create reusable components for their code, making it easier to maintain and modify. In this article, we will explore the basics of classes in Python and how to use them effectively in your projects. Basic Principles of Object-Oriented Programming Object-oriented programming (OOP) is a programming paradigm that uses objects and their interactions to design appl
年末年始にスライドを作ろうと思って挫折しました。 RSpec のテストコードは見慣れない "should" なんかが出てきて難しそうに見えますが、実は覚えなきゃいけないのは 4つ程の語彙だけです。*1 Object#should_xxx [args] Object#should_have(n).items Object#should_not_xxx Proc#should_raise() Object#should_xxx [args] 超基本の書き方です。should_ の後に続いたメソッドを呼び出し、その結果が真ならパスします。args で、そのメソッドヘの引数も与えられます。これだけだとイメージし辛いと思いますのでいくつか例を。 "?"は付いても付かなくても OK だったと思います。 1.should_equal 1 Fixnum#equal を呼び出してます。上記の例では下記の判定
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く