LoginSignup
1
3

More than 3 years have passed since last update.

引数から値を得る shared_context, 引数がなく let で値を得る shared_examples

Last updated at Posted at 2019-10-10

いつも忘れるのでメモ

引数から値を得る shared_context

shared_context :validation do |type, expected|
end

include_context :validation, :empty, false

引数がなく let で値を得る shared_examples

shared_examples :validation do
  if expected
  else
  end
end

it_behaves_like :validation do
  let(:expected) { true }
end
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3