RSpec and Cucumber: Shorthand syntax to run multiple line numbers in the same file
Run multiple example or scenario line numbers from one file with rspec or cucumber, using colon-separated targets instead of separate commands.
Spreewald: patiently blocks must not change variables from the surrounding scope
patently blocks must keep local variables inside the block; rebinding an outer variable breaks retries because later attempts reuse the changed value.
An auto-mapper for BEM classes in Cucumber selectors
BEM-style selectors can be generated from plain-language Cucumber locators, reducing repetitive typing when mapping readable step text to CSS classes.
How to use triple quotes inside a Cucumber docstring
Cucumber docstrings break when nested triple double quotes appear inside the text; escaping or a Transform can preserve embedded quote markers.
Cucumber factory 1.10.0 released
Cucumber factory now infers the model class from the factory, so steps can use natural names like admin instead of user (admin).
Spreewald: Click on an element with a CSS selector
Clicking elements by raw CSS selector is brittle; selector_for lets feature steps use plain English names like sidebar instead.
Perform Sidekiq jobs immediately in development
Run Sidekiq jobs synchronously in development to avoid a separate worker process and benefit from code reloading.
RSpec: How to compare ISO 8601 time strings with milliseconds
Rails JSON serializes times with milliseconds, so iso8601 and to_json can differ in RSpec expectations. Using to_json keeps time string comparisons matching.
weighttp - a lightweight and simple webserver benchmarking tool
Threaded web server benchmark can exhaust application resources more effectively than ApacheBench or httperf; libev is required for installation.
Cucumber: Check if a select field contains a disabled option
Capybara and Cucumber can verify that a select box includes a disabled choice, using an XPath check on the matching option element.
CucumberFactory 1.11 lets you use FactoryGirl traits
CucumberFactory 1.11 adds support for FactoryGirl traits, letting Cucumber steps create records with named variations such as vintage and moody.
RSpec example groups can be named using symbols
RSpec example groups and shared examples can use symbols as names, even though the official docs do not mention it.
Sync confidential files between unixes using cloud storage and encfs
Encrypted file sync across Unix machines keeps confidential documents in cloud storage while encfs protects the contents from the provider.
How to reset a Mock
Mock expectations in RSpec can linger across examples; resetting a proxy removes the configured doubles and returns the object to its original state.
grosser/rspec-instafail
Gem for instantly showing failing specs while continuing to run the rest of the suite, instead of aborting on the first failure.
Make Makandra Consul work with RSpec 2.x and Rails 3.x
Using Consul’s authorization matcher with RSpec 2.x on Rails 3.x can fail because of version incompatibilities. Compatibility requires adapting the matcher setup.
Fix "private method `select' called for Capybara::Node::Element
Capybara and selenium-webdriver version mismatches can break element interaction with a private select method error. Aligning gem versions avoids the API incompatibility.
Cucumber Factory: How to assign polymorphic associations
Polymorphic associations in Cucumber Factory require named associations; indirect references like owner above fail when the target type is ambiguous.
Webmock's hash_including doesn't parse query values to string
hash_including in WebMock v3.0.1 compares query values as strings, so integer expectations fail unless the request matcher uses '1' instead of 1.
Howto transfer a single mysql table between several deployment stages
Copy a single MySQL table between deployment stages by dumping it from one database and importing it into another; imports overwrite existing tables, not merge them.
Minimal JavaScript function to detect version of Internet Explorer or Edge
User-agent sniffing can still be necessary when Microsoft browsers need special handling. ieVersion() extracts Internet Explorer 10/11 and Edge version numbers, returning undefined for others.
Rspec: Complex argument expectations for should_receive
Tight should_receive(...).with(...) expectations on hashes are brittle and produce unreadable failures. Block-based argument checks keep RSpec assertions clearer and more flexible.
Cucumber step to pick a datetime in Rails' horrible datetime_select
datetime_select creates a clumsy date and time chooser in Rails; a visual picker is usually better, but a Cucumber step can still drive it.
Debugging in Cucumber
Useful Cucumber steps help inspect a Capybara session by opening the current page in a browser or starting an interactive debugger.