Shared examples let you describe behaviour of classes or modules. When declared, a shared group's content is stored. It is only realized in the context of another example group, which provides any context the shared group needs to run. A shared group is included in another group using any of: include_examples "name" # include the examples in the current context it_behaves_like "name" # include the
rspec-rails extends Rails' built-in testing framework to support rspec examples for requests, controllers, models, views, helpers, mailers and routing. rspec-rails 6 supports Rails 6.1 to 7.0. For earlier versions of Rails, you should use rspec-rails-5 for Rails 5.2 and 6.0, rspec-rails-4 for Rails 5.x, and rspec-rails 3 for even older versions. Install gem install rspec-rails This installs the fo
rspec-expectations ships with a number of built-in matchers. Each matcher can be used with expect(..).to or expect(..).not_to to define positive and negative expectations respectively on an object. Most matchers can also be accessed using the (...).should and (...).should_not syntax; see using should syntax for why we recommend using expect. e.g. expect(result).to eq(3) expect(list).not_to be_empt
Use subject() in the group scope to explicitly define the value that is returned by the subject() method in the example scope.
Feature specs are high-level tests meant to exercise slices of functionality through an application. They should drive the application only via its external interface, usually web pages. Feature specs are marked by :type => :feature or if you have set config.infer_spec_type_from_file_location! by placing them in spec/features. Feature specs require the Capybara gem, version 2.13.0 or later. Refer
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ページを開く