Your favorite test "gemstone (s)" or "plugins" in ruby โ€‹โ€‹and rails

Good. I am interested in TDD and testing in general. I personally find this a good practice when developing.

Since I practice ruby, I have never felt the need to try some โ€œtouchstonesโ€, for example, rspec. I tried Cucumber for high level testing and webrat for integration testing.

What are the jewels you like and why?

Please provide some examples or pointers to websites explaining the differences.

For example, why should I switch from basic unit testing? FWK rails give me rspec? From webrat to capybara? From cucumber to stack?

It can be useless things, such as: I like this one because the console output is colored as more important things, such as: I like this one because I find it more expressive when writing ++++ against this: ++++ .

If this question already exists, juste send me a link!

EDIT

I changed the title to be more explicit!

+3
source share
3 answers

There is only an insane amount of test frameworks available to the ruby; choosing one of them comes to personal preference. My personal favorite is riot

Riot , . - , "" , "". , , ( ).

readme

context "An Array" do
  setup { Array.new }

  context "with one element" do
    setup { topic << "foo" }
    asserts("is not empty") { !topic.empty? }
    asserts("returns the element on #first") { topic.first == "foo" }
  end
end

topic - , , setup. , "Assertion Macros", . denies, asserts . ,

context "An Array" do
  setup { Array.new }

  context "with one element" do
    setup { topic << "foo" }
    denies("is not empty") { topic }.empty?
    asserts("returns the element on #first") { topic.first }.equals('foo')
  end
end

, , , .

, , , , , , . , . , , , , .


, TDD, - spork. , 30-40 , , tdd. , spork , , . , .

rspec, /. ( , )

+3

minitest (cheatsheet), . unit test, ( ). , Cucumber " " ( " ", Perl APL:).

+2

:

Cucumber ( Aruba CLI)

  • - .
  • , .

RSpec 2

  • Again a more natural language approach is a huge help. I hate everything that mumbo-jumbo claims.
  • Tons of coincidences, I did not encounter a state that I could not verify, as I have with Aruba.
  • It is really, very easy to use.

Autotest for continuous testing.

  • It can run all major testing platforms.
  • It has growl support, so I can just see a popup when the test failed.
+1
source

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


All Articles