JavaScript's NaN ("Not a Number") is hard to compare against. It never equals anything, not even itself:

To check if a method has been called in Jasmine, you first need to spy on it: let spy = spyOn...

github.com

Because colors improve readability so much. On Ubuntu 18.04 you can install it with sudo apt install grc

So you're getting an error message like the following, although your Gemfile lists shoulda-matchers and it has always...

Observed on Rails 2.3 and machinist 1.0.6 Like the title says, when you define the method empty? like in the...

...but not your rerun.txt.\ This sometimes happens when running multiple Cucumber workers with parallel_tests that write into rerun.txt simultaneously -- ending up with a messy, invalid file. Just remove it...

...a support module from rspec-rails: FactoryBot::SyntaxRunner.include(RSpec::Rails::FileFixtureSupport) That includes ActiveSupport::Testing::FileFixtures, where file_fixture is defined, but also configures the file_fixture_path so that...

I encountered a bug in RSpec 1.x where stubbed class methods ("static methods") would not be unstubbed before the...

script/cucumber features/feature_name.feature Or, if you don't care about speed, you can use rake: rake features FEATURE=features/feature_name.feature

This error occurs when passing an object instead of a string to Jasmine's describe(): # Bad describe(HoverClass, function() {...

To improve your chances to get proper error messages, you can try ^ to start cucumber with the -b option, so...

MAIL_RECIPIENT=you@example.com # eMail address where to send failures to. NUMBER_OF_TEST_PACKETS=5 # Number of ICMP packets to be sent to the target. If any fails...

...you'll get notified. function do_monitoring { ping -q -c $NUMBER_OF_TEST_PACKETS $TARGET status=$? if [ $status -ne 0 ]; then mail_traceroute $TARGET fi return $status } function mail_traceroute...

Are you adding a "Then show me the page" and re-run Cucumber whenever there is a failing scenario? Don...

The attached patch lets you find a record by a string or number in any column: User.find_by_anything('carla...

This finally works: User.any_instance.should_receive(...) as does User.any_instance.stub(...) Note: You won't have RSpec 2.6 if you're still working...

makandracards.com

In Spreewald 1.10.4+, nested patiently blocks are now patient. Here is an example: patiently do outer_code patiently do

When you cannot make Selenium trigger events you rely on (e.g. a "change" event when filling in a form field...

TL;DR In blueprints, always wrap associations in blocks. # Broken Task.blueprint(:vacation) do project Project.make(:vacation) hours 8 accounting_method...

Consider the following: describe '#something' do context 'with lots of required arguments' do it 'should work' do subject.something(:foo => 'foo...

If you are trying to integrate VCR and Cucumber 4 and you're using the use_scenario_name: true option...

I recently enjoyed debugging a Cucumber step that tried to be retryable using a patiently block: Then /^"([^"]*)" should( not)? be...

In a nutshell: Capybara's find will not work properly on nodes from a list. Don't find on elements...

This works in modern RSpecs (RSpec >= 2.x) and Cucumbers: rspec spec/models/node_spec.rb:294:322 cucumber features/nodes.feature:543:563:579

When you are using the #selector_for helper in Cucumber steps, as e.g. Spreewald does, the following snippet will save...