Noel Rappin Writes Here

Tag: rspec

How To Manage Duplicate Test Setup, or Can I Interest You In Weird RSpec?

You have a series of test cases. They cover the same logic with different inputs. In order to get to that logic, there’s some overhead: objects have to be created first. Then there’s more logic needed to evaluate the result. What’s the best way to manage these tests? You want it to be easy to add new tests. You also want it to be clear what part of the test is different in each round and what part is just the common logistics.

May 9, 2012: The Random Link Post Returns

And now, the return of the semi-occasional link post. I’m going to try to do this at least once a week, but who knows. If you are writing JavaScript, you should be looking at Justin Searls and his JavaScript testing tools. Justin posted the slides for what looks like a great talk on JavaScript testing. These slides made me happy. In random media sales, the audio book of World War Z is on sale for a mere six bucks.

August 24, 2010: Um.. Hi?

It’s very easy to let this blog habit slip through your fingers. You go from, “put something up every weekday”, to “nobody reads this on Friday”, to “I’m tired this mornng”, to “wow, I haven’t posted in a week, and nobody noticed, why post today”. Anyway, here’s a post. Book Status Beta 6 came out last week. I’m now going through the RSpec chapter, which is taking longer than I thought.

Aug 9, 2010: I Shouda Seen This Coming

Book Status The Shoulda chapter is draft complete, after a slight restructuring to change the emphasis of the chapter, and a lot of syntax changes. My previous version of the chapter was written before Shoulda went in the direction of RSpec compatibility and so there were a lot of syntax changes that needed to be made, particularly to the way you create Shoulda extensions, which used to be much simpler.

July 19, 2010: Building a Legacy

And Now A Word The schedule for WindyCityRails 2010 just came out. WindyCityRails is Saturday, Sept, 11 at the Westin Chicago River North. I will be running the PM tutorial session on “Testing in a Legacy Environment”. I am frequently asked how to start testing on a pre-existing code base with no tests. In this session, we’ll start with a made-up “legacy” code base, and discuss techniques for adding tests, and fixing bug, and adding new features in a test-driven way.

July 13, 2010: I Guess It Isn't A Dynabook Yet

Status Back to link posts today. The book is still lurching forward on the legacy chapter. Thanks to those couple of you that asked questions on the forum and made it look a little less lonely over there. Quick Review Quick iPhone 4 impressions, but understand that I haven’t actually, you know, used it yet, just took it home and set it up. The screen sharpness really is notice able.

July 7, 2010: Dylan Goes Electric (Probably Not True)

Book Status Beta 4 should be available this week, or at the latest Monday, apparently we’re working around people’s vacation schedules. It will have two new chapters, and some error fixes and tweaks around the book. Next is on to Beta 5. In status news that shouldn’t interest you much, the end of the quarter meant the end of my first Pragmatic pay period. And apparently Pragmatic pays as soon as possible, rather than waiting 30 or 90 days after the end of the pay cycle.

July 2, 2010: Cease and or desist

Book Status And now I turn my lonely eyes to the chapter on testing legacy code. I liked this chapter in the original book, and it’s something I get asked about pretty consistently, so I really want to make it great. Links I’m personally going to spend a lot of time with David Chelimsky’s post about RSpec 2 docs. It’s the best listing I’ve seen so far about changes between RSpec 1 and RSpec 2.

June 16, 2010: What Shoulda We Do?

Top Story Thoughtbot talks about their plans for Shoulda moving forward. The big takeaway is that, while the context library will be separated out for use in Test::Unit, both Shoulda style and Shoulda effort will be focused on RSpec integration. I have some complicated thoughts about this one. I’m thrilled that Shoulda is being maintained – it’s a tool I’ve used a lot, and I was starting to get worried. And they should move their open source tool in any direction they want.

June 1, 2010: June, she'll change her tune

iPad Note I keep wanting to write about the iPad, but so, so many other people are writing about it that I’m not sure I have anything to add. More or less at random, I really liked the brief rant Joe Posnanski added in the middle of an otherwise-unrelated blog post, and Charles Stross’ typically complete take. Right now, I just would add that I still use it more than I thought, that the form factor makes more of a difference than I expected (being able to easily walk to show the screen).

Rails Rx Standup: April 12, 2010

Top Story For a while, it looked like the top story was going to be Apple’s new developer Rule 3.3.1, described here by John Gruber. More on that in a second. But the real top story is the news that Twitter has bought Tweetie, intending to rebrand it as Twitter for iPhone, and dropping the price to a low, low, free. Eventually, it will be the core of Twitter for iPad.

RSpec and Mock Design Question

Here’s a little RSpec design question. As I’ve probably mentioned in various spots, I don’t naturally take to the RSpec massively-mocked style of testing. However, I’m currently on a Rails project that is using that style – unit tests don’t touch the database, functional tests don’t touch the models. It seems to be working for them, they certainly seem to have stuck with it over the course of this rather complex application.



Copyright 2024 Noel Rappin

All opinions and thoughts expressed or shared in this article or post are my own and are independent of and should not be attributed to my current employer, Chime Financial, Inc., or its subsidiaries.