Episode Details
Back to Episodes
382: Domain-Specific Languages
Description
Joël has been integrating a third-party platform into a testing pipeline...and it has not been going well. Because it's not something she usually keeps up-to-date with, Stephanie is excited to learn about more of the open-source side of things in Ruby, what's new in the Ruby tooling world, and what folks are thinking about regarding the future of the language.
Today's topic is inspired by an internal thoughtbot Slack thread about writing a custom matcher for Rspec. Stephanie and Joël contrast DSLs vs. Object APIs and also talk about:
- CanCanCan vs Pundit
- RSpec DSL
- When is a DSL helpful?
- Why not use both DSLs & Object APIs?
- Extensibility
- When does a DSL become a framework?
This episode is brought to you by Airbrake. Visit Frictionless error monitoring and performance insight for your app stack.
- RubyKaigi 2023
- Mystified by RSpec’s DSL? by Jason Swett
- Building Custom RSpec Matchers with Regular Objects
- FactoryBot
- Writing a Domain-Specific Language in Ruby by Gabe Berke-Williams
- Capybara
- Acceptance Tests at a Single Level of Abstraction
- CanCanCan
- Pundit
- Discrete Math and Functional Programming
Transcript:
STEPHANIE: Hello and welcome to another episode of The Bike Shed, a weekly podcast from your friends at thoughtbot about developing great software. I'm Stephanie Minn.
JOËL: And I'm Joël Quenneville. And together, we're here to share a little bit of what we've learned along the way.
STEPHANIE: So, Joël, what's new in your world?
JOËL: I've been integrating a third-party platform into our testing pipeline for my client. It has not been going well. We've been struggling a little bit, mostly just because tests just kind of crash. Our testing pipeline is pretty complex. It's a lot of one script, some environment variables, does a few things, shells out to another script, which is in a different language. Does a few more things, shells out to another script, maybe calls out to rake, calls out to a shell script. There are four or five of these in a chain, and it's a bit of a mess.
Somewhere along in there, something is not compatible with this third-party service that we're trying to integrate with. I was pairing this week with a colleague. And we were able to reproduce a situation where we were able to get a failure under some conditions and a success under other conditions. So these are basically, if we run the whole chain of scripts that call each other from the beginning, we know we get a failure. And if we skipped entirely the chain of scripts that set up things and then just manually try to invoke a third-party service, that works.
And so now we know that there's something in between that's incompatible, and now it's just about narrowing things down. There are a