Is there an alternative to "this" in RSpec tests?

Some RSpec methods have aliases for how you express them, for example. describeand contextboth do the same thing.

It is not always useful to start the specification with it- are there any alternatives to how this part of the test can be phrased?

eg. It would be nice to formulate the following:

context "when copying a Page object" do
  expect_that "the image gets copies" do 
    ...
  end
end

Are there aliases for itwhich you can use?

+4
source share
1 answer

specifyis a minimally documented synonym it. examplealso a synonym, but I don't know any documentation.

its, RSpec 3.0.

+4

Source: https://habr.com/ru/post/1523882/


All Articles