Cucumber's table diffing does not play nice with Spreewald's `patiently do`
Cucumber::MultilineArgument::DataTable#diff! caches state, so repeated checks inside patiently do keep failing; expected_table.dup.diff! avoids the stale comparison.
Sentry Local Logging in Ruby
Local Sentry event logging helps debug error capture and background jobs without sending data to Sentry or affecting production metrics.
RSpec: Expect one of multiple matchers to match
RSpec allows chaining matchers with .or, so an expectation passes when any one matcher matches. Useful for Capybara checks across different button renderings.
Ruby: Reading and writing CSVs
Ruby can read and write CSV files with the standard CSV library, and smarter_csv makes imports more convenient when converting rows into hashes.
Geordi hints
Quick Geordi command shortcuts for guided deployment, setup, security updates, tracker-based commits, and matching ChromeDriver installation.
Know what makes your browser pant
Changing CSS properties can trigger different amounts of browser work, affecting performance when styles are updated.
How much should I refactor?
Balancing refactoring with complexity is difficult when new patterns promise cleaner, more testable Rails code. Choosing when to apply them keeps code maintainable without overengineering.
Random list of ActiveSupport goodies
Handy ActiveSupport helpers add callbacks, message signing and encryption, ordered options, array wrapping, deep hash merging, whitespace squishing, and zone-aware current time.
The Startup Toolkit
Practical crash courses for founding a startup, raising funding, and testing ideas before building too much.
Browsera - Automated Cross Browser Web Application Testing Service
Automated cross-browser testing finds layout problems and scripting errors on websites before users do.
Three quick Rails console tips
Rails console access to routing helpers, request simulation, and view helpers speeds up debugging and quick checks without leaving rails console.
RSpec 3 argument constraints use weak equality
RSpec 3 argument matching can accept broader values than strict equality, especially for classes, regexps, and ranges. Use eq or a block for exact expectations.
Bash script to list commits by Pivotal Tracker ID
Quickly list Git commits tied to one Pivotal Tracker story ID, making related changes easier to spot with a small Bash helper.
Cucumber pitfall: "Around" does not apply to your "Background" steps
Around hooks run only after Background steps, so setup or teardown placed there cannot affect background actions. Use Before and After hooks instead.
Using RSpec stubs and mocks in Cucumber
Cucumber can use RSpec doubles instead of Mocha; loading the integration in env.rb keeps stubs and mocks available after other After hooks.
How to find out if you are in Cucumber or in RSpec
Feature and spec code may need different behavior when Rails env is unavailable. Capybara.current_driver can distinguish Cucumber scenarios from RSpec examples.
Bug in Chrome 56+ prevents filling in fields with slashes using selenium-webdriver/Capybara
Chrome 56+ can drop slashes when fill_in runs through Selenium and Capybara, breaking form input for paths and HTML strings; a JavaScript workaround updates the field directly.
Spreewald: Old-school cucumber steps, freshly pickled
Spreewald keeps Cucumber-style web steps available while adding reusable steps for emails, tables and time travel in a Ruby gem.
Ruby: How to measure code execution time in an IRB or Rails console
IRB and Rails console sessions can time code execution directly with measure; older versions can use Benchmark.measure for manual timing.
RSpec < 2.11: ActiveRecord scopes must be loaded before using the "=~" matcher
ActiveRecord scopes must be converted to arrays before using RSpec =~, or array comparison can fail. match_array and contain_exactly are preferred in RSpec 2.11 and later.
Testing with IE6, IE7 and IE8 on VirtualBox | Shape Shed
Free browser testing setup on OSX or Ubuntu using VirtualBox makes legacy Internet Explorer versions available without Parallels.
Hack of the day: One-liner to run all Cucumber features matching a given string
Run only matching Cucumber feature files by searching .feature files for a string and passing the matches to geordi cucumber; similar xargs pipelines work without Geordi.
Ruby: Enumerable#partition
Split an enumerable into matching and non-matching groups with Enumerable#partition, returning two arrays and working naturally with destructuring assignment.
Bash script to run specs and features
Run rspec and Cucumber from any project directory with optional spinner support; features are skipped when specs fail.