PyConJP 2021 2021/10/15 位置データもPythonで!!!発表資料 合同会社長目 小川 英幸 github: https://github.com/mazarimono/pyconjp2021
![RSpecしぐさ](https://cdn-ak-scissors.b.st-hatena.com/image/square/0f67dae85ee677b3e98e72fa8ebcc2e7d0732535/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2F20171209rspec-171209035128-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)
What is Better Specs Better Specs is a collection of best practices developers learned while testing apps that you can use to improve your coding skills, or simply for inspiration. Better Specs came to life at Lelylan (open source IoT cloud platform) and checking out its test suite may be of inspiration. Better Specs focus on Rails testing, but our goal is to create testing guidelines covering mos
Structure of RSpec tests Disclaimer Assume that you know RSpec. If not, you'll still get some value. Overview describe vs. context context naming before vs. let before & context let vs. subject before vs. let subject & describe A typical test describe Classroom do context "#a_mess?" do it "should return true after a party" do classroom = Classroom.new classroom.throw_pizza_party classroom.a_mess?.
Myron Marston » New in RSpec 3: Composable Matchersの訳です。 あかんところあったらTwitterで@nilp_までお願いします RSpec 3の、最も大きな新機能が3.0.0.beta2で公開されました: コンポーザブルマッチャ(組み合わせ可能なマッチャー)です。 これにより強力で壊れづらい検証を書けるようになり、新たな可能性が開けました。 例 RSpec 2.xでは、私はこのようなコードを度々書いてきました。 class BackgroundWorker attr_reader :queue def initialize @queue = [] end def enqueue(job_data) queue << job_data.merge(:enqueued_at => Time.now) end end describe Back
Take very small stepsDon’t rush ahead with more code. Instead, add another example and let it guide you to what you have to do next. And don’t forget to take time to refactor your code before it gets messy. You should keep your code clean at every step of the way. View Documentation The BookEffective Testing with RSpec 3: Build Ruby Apps with ConfidenceThis definitive guide from RSpec’s lead devel
RSpecの話です。 RSpecは、テストコードがそのまま仕様を記述するドキュメントになる、というのが大きな利点の一つです。 しかし、rspecコマンドに-dオプションを渡して出力されるドキュメントは、必ずしも読める文章になっているとは限りません。 例として、以下のようなCanCanのspecを見てみます。 require 'spec_helper' require "cancan/matchers" describe Ability do context 'an user' do let(:user) { Factory.create(:user) } let(:article) { Factory.create(:article) } let(:own_article) { Factory.create(:article, :user => user) } subject { Abil
RSpec is a Behaviour-Driven Development tool for Ruby programmers. BDD is an approach to software development that combines Test-Driven Development, Domain Driven Design, and Acceptance Test-Driven Planning. RSpec helps you do the TDD part of that equation, focusing on the documentation and design aspects of TDD. Documentation This is the official documentation site for RSpec. Much of the document
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く