Logo

TODAY I LEARNED

A1d6462f1fe0a5baf7b66d223639c8d6

3 posts by victor-delarocha

to install ruby 2.4.6 on a Mac m1 with rbenv

Once upon a time (even thouhg we have newer versions of ruby) I had to install an older version of ruby, the 2.4.6 on my Mac M1 (OS X 12.6), I was having this problem:

ruby-build: using readline from homebrew

BUILD FAILED (macOS 12.6 using ruby-build 20220910.1)

So after googling I found that we can do this:

CFLAGS="-Wno-error=implicit-function-declaration" RUBY_CONFIGURE_OPTS='--with-readline-dir=/usr/local/opt/readline/' arch -x86_64 rbenv install 2.4.6

and it worked!

that's it bye!

Learned by victor-delarocha on Sep 27, 2022

973983 adforcodereview v3 0211021 c02 021121

Behavior of Capybara's "have_no_content" when expected with `.to_not` and with `.to`

about to_not have_content:

  expect(page).to_not have_content("not on page")

it waits (Capybara's default waiting time), then it pass. Don't use it! 🚫

whereas to have_no_content:

  expect(page).to have_no_content("not on page")

Waits (same as with .to_not) but it passes as soon as "not on page" disappears from the page; use this one to wait for loading messages to disappear! ✅

Learned by victor-delarocha on Apr 21, 2022

973983 adforcodereview v3 0211021 c02 021121

while on a Capybara / Cucumber test execution How to save and open the page as snapshot in a browser for inspection

While debugging a cucumber test (within an specific step for an specific scenario) with a binding.pry I wanted to see the html as it is with inputs and outputs of data at the moment (and because I usually run tests with Capybara headless option), I realized the existance of:

save_and_open_page

it Saves a snapshot of the page and open it in a browser for inspection

https://www.rubydoc.info/github/jnicklas/capybara/Capybara%2FSession:save_and_open_page

Note: ^ be sure to have the gem 'launchy' within test env so that it works

Learned by victor-delarocha on May 12, 2021

973983 adforcodereview v3 0211021 c02 021121