At Lifen, we cut one of our highest-traffic Ruby on Rails API endpoints from 1.2s to 225ms response time 🎉
Here's a technical article I wrote about this process:
lifen.substack.com/p/slashing-a...
#Ruby #RSpec #Testing #Rails #OpenSource #TechWriting
Claude Code plugins for #Ruby / #Rails - LSP, #RSpec, #ActiveRecord, #MCP, Draper. PRs welcome.
github.com/hoblin/claude-ruby-marketplace
🥳 Happy 30th birthday to #RubyLang, still my favorite programming language! Here's a coupon for my #RSpec book for just $9, with practice #TDD advice. Free updates for Rails 8.1 and Ruby 4 coming early next year! Boosts appreciated! 🥳
Blog post header image with white title "RSpec Tips & Tricks" and red subtitle "Rspec & testing using capybara" on black background. Features cute orange capybara mascot with question mark. Shows author Amanda Klusmeyer (Developer) with profile photo and Flagrant branding.
🧪 Amanda's RSpec debugging gems! CHROME=true for live test watching, save_and_open_screenshot for visual snapshots, save_and_open_page for HTML inspection. Essential for flaky spec debugging!
www.beflagrant.com/blog/rsp...
#RSpec #RubyOnRails #Testing
TIL in #Ruby #RSpec,
this:
expect(File.exist?(old_file)).to be true
can be shortened to this:
expect(File).to exist(old_file)
expect(File).to exist old_file
Neat!
2 months since I shared my first gem 🥳
I thought it might be time to repost myself for the occasion.
#Ruby #RSpec #Testing #Rails #OpenSource #TechWriting
Hey #RubyFriends (and other friends too) 👋 I shipped a big change to my #RSpec book yesterday; here's a post about what's new and what's next. I appreciate your support!
I shared this the other day and mentioned how close I am on wrapping the current iteration of my #RSpec book. After a very productive flight, I'm happy to say the book is code complete! Now writing some remaining English words to explain my thinking, then on to your reader of choice. 😁
Hey #RubyFriends, I haven't talked much #Ruby this summer. Life's been full, and I don't write much in my favorite language at my day job right now. But I am very close to (finally!) wrapping up the current edition of my #RSpec book. One more chapter to go!
💎 Fresh from the gem mine - timecop-rspec
Provides actual time-machines for RSpec that allow you to time-travel test examples, context/describes, and/or your entire test suite. Find out what your test will behave like... tomorrow! #Ruby #FLOSS #RSpec
github.com/galtzo-floss...
Software developer friends: When you're learning from a book, do you find end-of-chapter independent exercises useful, or skip them? I'm struggling a bit with meaningful exercises as I wrap up this version of my #RubyOnRails #RSpec book. (Boosts appreciated!)
🧵 Just published my deep dive into building RspecTimeGuard - a gem that stops RSpec tests from hanging indefinitely!
🔗 Gem: github.com/LucasMontori...
#Ruby #RSpec #Testing #Rails #OpenSource #TechWriting
Looking for that satisfying ‘I made my bed today’ kind of feeling? Check Cody Brooks' blog post and learn how to use FactoryBot with Plain Ole Ruby Objects (PORO) for all the details. www.beflagrant.com/blog/usi...
#Testing #FactoryBot #RSpec #Ruby #PORO #Software #Development
Hey friends! Just a reminder that this sale is going on all month. ❤️ to all your support these past 15 years. (And if $9 is out of your budget, DM me for a freebie link, no questions asked) #RSpec #RubyOnRails #RubyFriends #IndiePublisher
Anyone have better approaches to wiping Active Storage files after #RSpec test runs in #RubyOnRails?
```
config.after(:suite) do
dir = ActiveStorage::Blob.services.fetch(:test).root
FileUtils.rm_rf(dir)
FileUtils.mkdir_p(dir)
FileUtils.touch(File.join(dir, ".keep"))
end
```
Welp, my improptu 15th anniversary sale became a "just needed to buy a new washer/dryer" sale 😭 $9 for lifetime free updates to my #RubyOnRails #RSpec book! Sharing is caring!
The output of RSpec's "expect(thing).to recieve(:act).with('foo')" can be a pain to debug if "act" is called with things other than "foo". But TIL combining "expect" with "allow" lists the calls:
class Dog
def say(sound); end
end
it "says bark" do
dog = Dog.new
allow(dog).to receive(:say) […]
#ForSale: 2020 #Yamaha #Bolt #RSpec - #Motorcycles - #AustinTX at #Geebo
austin-tx.geebo.com/vehicles/vie...
Made a small gem to allow switching from class to test - and back - in #zed
github.com/MoskitoHero/...
It’s still at an early stage, so I suspect it might not work in some projects. But it understands if you are using #rspec or #minitest.
#ruby #gem
💥 I shipped a new chapter for the current edition of Everyday Rails Testing with #RSpec! I’ve overhauled my introduction to testing in isolation with mocks (and stubs, and fakes, and spies, and doubles, oh my). 💥
Free update on Leanpub: https://leanpub.com/everydayrailsrspec/
#RubyOnRails
#RubyOnRails pals—I'm not super in-the-loop at the moment, but is there a ballpark on when Rails 8.1 is going to drop? For context, I'm thinking about pausing on content updates on my #RSpec book, do a quick 8.0 update for the chapters done so far, then wrap up the remaining chapters.
Updating coverage of the Ruby "VCR" mocking package in my #RSpec book, and thinking how many younger people have likely never even seen a VCR, much less a TiVo—which then reminded me of the behemoth ReplayTV that sat under my cathode ray television in the aughts. 👴
Finally got an update to my #RSpec book for #RubyOnRails shipped this afternoon, with new content on tools for DRYer tests, and when they're a good idea or a bad idea. Free update as usual!
Heya #TDD fans, especially #RSpec users: Feelings about testing at a single level of abstraction? Debating whether to include it again (with revisions) in my RSpec book updates. I like it in principle; is the extra setup worth the improved readability to you?
So I was looking for #rspec integration of difftastic and there was none, so I made one. After playing a bit on a private repo, I pushed to GitHub and upon trying to publish the gem, the name was taken. So someone pushed one 2 days ago 🤷♂️ Anyway, now I’ll contribute, as I did a bit deeper integration
A prompt from Cursor AI editor asking it to write a script that will find combinations for all test scenarios from one file and run them along with another file to find the combination that causes failure in that other file
Terminal showing output from running the script that found the offending scenario
One more prompt and we found the culprit 🙃 Now I just asked it to find which specific spec scenario causes our failure and 💥 got it, fixed it, and now I also know that there's state leaking between specs which I want to address in a generic way. Win!
#aicoding #testing #rspec #debugging #ruby
🎙️New Episode Alert!🎙️
Steven and Philippe joined me to dive deep into testing and RSpec. We covered best practices, common pitfalls, and shared some real-world insights that every developer can relate to.
Listen here: open.spotify.com/episode/08C0...
#Podcast #RSpec #Testing #TechTalk #Ruby
Because I CAN'T just go by the book, I am making work for myself that no one asked me to do... because learning. So I am working through Effective Testing with #RSpec 3 with the @wnb_rb bookclub, but it uses #sinatra which is a perfectly nice, very easy to use framework. And I just wanted to […]