rspec shared examples vs shared context

shared_examples are tests written in a way that you can run them in multiple settings; extracting common behavior between objects.

it_behaves_like "a correct object remover" do
    ...
end

shared_contexts is any setup code that you can use to prepare a test case . This allows you to include test helper methods or prepare for the tests to run.

include_context "has many users to begin with"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)