You are currently browsing the tag archive for the 'rspec' tag.
I’d forgotten how fun trying to pull all the pieces together on a last-minute high-pressure project could be.
I’ve shut down and reformatted my Windows desktop for good (I hadn’t turned it on for six months or so, it just took me this long to get around to reformatting the drives). If anyone wants a deal on a Dell PowerEdge 1800 server before I EBay it, holler.
Yesterday saw my first posting to the official Rails weblog. A nice step on the way to world domination, I guess.
I tossed out a few more bits of open source code over the weekend: a fork of suprails (though actually I hope the original project just merges my one tiny change), and a proposed change for Rails core (which you’re welcome to go test and, hopefully, +1).
I was complaining a few days ago that I was having trouble with authentication in cucumber stories in conjunction with RSpec. It turned out I was making a very stupid mistake (”administrator” and “admin” are not, in fact, the same thing). But in the interests of helping out anyone who ends up here via search engine, here’s how I’ve got it sorted out for now.
Here’s one of our current cucumber scenarios:
Scenario: See all vendors Given I am logged in as a user in the administrator role And There are 3 vendors When I go to the manage vendors page Then I should see the first 3 vendor names
And here’s the corresponding part of the step file that handles the login:
Given /i am logged in as a user in the (.*) role/i do |role|
@user = Factory.create(:user, :name => "the user",
:login => "the_login",
:password => "password",
:password_confirmation => "password")
@role = Factory.create(:role, :rolename => role)
@user.roles << @role
visits "/login"
fills_in("login", :with => "the_login")
fills_in("password", :with => "password")
clicks_button("Log in")
end
Note that I’m using Factory Girl to instantiate objects in this application’s tests.
There may be a better pattern for this - I’m just getting started with cucumber. But for now, it works for me.
My latest work in progress: The Rails Initialization Process.
- Custom Tags in Liquid - A useful tutorial for an area where there isn’t much available.
- cucumber-tmbundle - Another TextMate bundle for cucumber.
- rspec 1.1.8 - A quick revision of 1.1.5, which was just released.
- default_value_for Rails plugin: declaratively define default values for ActiveRecord models - A plugin from Phusion.
Anyone had to manage cucumber/webrat stories that include logging on to a session via restful authentication? How’d you do it?
- rspec plain text stories + webrat = chunky bacon - I’m scouring the net to figure out best practices for cucumber stories; there’s not much out there. This was helpful.
- Easy PlainText Stories in Ruby on Rails Using WebRat - More work on smart stories.
- RubyGems How-To: Preventing Catastrophe - Some notes on versioning.
Early mornings are the most peaceful time around here. Which may explain why I’m awake at 4AM.
- CouchDB with Rails - The latest screencast from PeepCode. CouchDB has been on my radar for a long time but I haven’t had a good excuse to use it yet.
- Reminder Tests - Dan Manges suggest some novel uses for automated tests. Well, novel to me, anyhow.
- Cucumber - Plain-text BDD tool that’s an alternative to RSpec stories.
- turled - The “look up Twitter users’ web sites fast” script has turned into a whole site, complete with my Ubiquity command.
I’ve now reached the point where setting up a new Rails server at RimuHosting is almost routine. I may know a thing or two about sysadmin after all.
- JustHackIt - Folks looking for other folks to hack code with, for fun or profit. Proof that having an idea is not the hardest part.
- RSpec: It Should Behave Like - RSpec pattern advice from Robby Russell.
Without Mondays to absorb all the extra email, Tuesdays would be a disaster.
- Fetches: Bringing your ActionController its Slippers - Rails plugin to dry out the plethora of @foo = Foo.find(params[:id]) calls that litter controllers.
- Announcing Cruise - ThoughtWorks are out with a new commerical continuous integration product that appears to compete directly with CruiseControl.
- Introducing ActivePresenter: the presenter library you already know - Presenter pattern implementation for Rails that feels very much like ActionController. (via RubyFlow)
- rspec-on-rails-matchers - Potentially useful addition to RSpec, though looking at the project network it doesn’t look like stuff has been merged back to the master copy lately.
- Open Source Rails - Collection of Rails applications, with a fresh design.
- Simple Localization in Rails 2.2 - A look at the coming feature. (via RubyFlow)
Sick kids have been taking more time than net cruising lately.
- New Controller Examples - David Chelminsky is experimenting with the scaffolded tests that RSpec generates for RESTful controllers.
- REST Anti-Patterns - Ways in which to drift away from RESTfulness when building a web service.
Switching an app from solr to ferret today…and crossing my fingers.
- Freeconomics Part I - or who is paying for your Free lunch? - Some basic economic analysis from Broadstuff that ought to be more obvious to those who claim there’s no bubble going on.
- RSpec waving ‘bye bye’ to implicit module inclusion - News of a change coming that will break RSpec compatibility.
- Download Day -The latest silly Firefox promotional stunt.
- Announcing non-profit Hobo Foundation - Looks like the Hobo additions to Rails have some money behind them now.
- TuneUp - New site/plugin from FiveRuns that sends perf information from your Rails site to a community discussion board (you choose which info to show) so others can help you troubleshoot. More info here.
I am convinced I am going to will the remaining unfixed bugs on one project to my heirs. Time to buckle down for another pass at them, I guess.
- RSpec-1.1.4 - Another maintenance release with a few new bits of syntactic sugar.
- Google-served JavaScript Libraries - You can now host your Prototype and Scriptaculous bits (among others) on Google’s servers.
- Sample OpenID application updated for latest Rails and OpenID gem - Ben Curtis continues to make life easy for folks who want to let folks use OpenID with Rails apps.
Moving back to more Rails work for the rest of the week, it looks like.
- git’ing started with RSpec - Pat Maddox shows how to use RSpec directly from the git repository.
- Default Routes Considered Harmful, and Other Rails SEO Tips - Rails for the URL structure obsessed. Personally, I’m not one of them, but I know that a lot of folks are.
- count vs length vs size - Josh Susser explains the difference in terms of Active Record.
- Testing in Rails: Part 11 - Running Unit Tests - More testing for fun and profit.
- Merbful Authentication Initial Merb 0.9 Support - Ready for use, apparently.
Nailed down another contract yesterday - this one for some design and building work in Second Life. Nice to have the billing base broadened a bit.
- About the Mac OS X 10.5.2 Update - This installed smoothly for me, though I’m not seeing any amazing changes (except for the temporary loss of my beloved GrowlMail again).
- Andrzej’s Rails tips #5 - A couple of nice RSpec-related tips.
- RubyFringe - Rails is too staid for some folks now; here’s a new conference for people who want to work with Ruby stuff (mainly web-related) “outside of the Rails monoculture.”
- Nginx & Memcached, a 400% Boost! - More fiddling with the Rails production stack.
I wasn’t able to post this yesterday because our T1 line went down for 16 hours. It was almost like living in the boondocks again!
- 21 Merb Links, Tutorials and Other Resources - A roadpmap of merb goodness collected by Peter Cooper.
- RSpec-1.1.3 and ZenTest-3.9.1 - How to match up your RSpec and ZenTest versions.
- Scout - Ruby-based web monitoring and reporting software. Doesn’t appear to be shipping yet.
I’m hoping some renewed energy and inspiration comes out of somewhere today, because I sure didn’t have any this weekend.
- Merb Supports rSpec Text Stories - Merb is reaching a tipping point very quickly, I think.
- The Maria engine is released - A new plug-in storage engine for MySQL.
- MultiRails 0.0.5 - A way to test your Rails code in multiple versions of Rails. Most useful to plugin authors, I think.
- Simpler than dirt: RESTful Dynamic CSS - Technique for having CSS that depends on the details of the current model instance. Check out the comments for some other alternatives.
- Write Only Ruby - Jay Fields takes DRY to its logical and absurd conclusion.
Whew, long weeks are good for billables but they make me ready for weekends. Oh, wait, I’m planning some work this weekend too.
- RSpec User Stories - The latest PeepCode screencast. I think I need to watch this one too.
- Run BASIC - On the other hand, I could just get back to my roots with this implementation of simple Liberty Basic as a web language.
As I expected, I’m really enjoying getting back several hours a day that I used to spend keeping up on .NET news.
- Skynet - Ruby implementation of Google’s Map/Reduce framework for distributing work across multiple computers. (via Anthony Eden)
- Thin - A new, and apparently faster, alternative to Mongrel for serving web sites. (via Ruby Inside)
- A Guide to Deploying Rails Applications - Setting up a Rails server isn’t really easy, but guides like this one are making it easier.
- Migrating from Test::Unit to RSpec - How to go from TDD to BDD in a few easy steps.
- Monitority - Another online web monitoring site.
I spent much of yesterday doing an archive & install on OS X 10.5 on my main dev box, then reinstalling all the gems I use. Took a while to get everything set up, but it was worth it to not have two installs of ruby and two battling sets of gems. I think.
- Rails 2.0.2: Some new defaults and a few fixes - Here’s the official announcement of yesterday’s minor Rails release.
- Rails 2.0.2 released, so what’s new? - Another take on the new features.
- Sqliteman - With Sqlite3 being suddenly the default Rails database (as of Rails 2.0.2), I spent some time looking around for Sqllite GUIs that work under OS X. (Yeah, I’m a wimp that way). This one has the advantage of being free, though it’s not real well-organized and has that Qt look to it.
- RazorSQL - Commercial database query tool that claims Sqlite compatibility via JDBC. Haven’t tried it.
- SQLite Manager 0.2.11 - Sqlite database tool implemented as a Firefox add-on. Actually not bad.
- What’s Coming in Instant Rails 2.0 and Beyond - The Road Map - Plans from the new project maintainer.
- Installing ruby mysql gem in OSX 10.5 - I decided I could do without building everything from source this time around. MySQL was the trickiest to get cooking from a download & gem install.
- Ruport 1.4 Preview Release - If you’re using Ruport for reporting you probably want to have a look at this.
- RSpec Textmate Bundle errors - I had a good deal of trouble getting RSpec to work correctly within TextMate. This thread describes the symptom, but the fixes there did not work for me. Ultimately I had to checkout the RSpec trunk svn, build that, and symlink the resulting TextMate bundle in to make sure everything was synched.
- Setting up autotest to use Growl - A nice little extra if you’re doing continuous testing.
- Bazaar - Distributed version control system with an easy migration path from subversion.
I spent most of yesterday learning about RSpec. Fun stuff, even if I can’t get the TextMate integration to work yet.
- A Meme I’d Like To Crush - Greg Wilson, who actually knows a thing or two on the subject, discusses the current swooning over Erlang ’cause it’s so parallelizable.
- Merb 0.4.2 released. - Just as I get interested, they push out a new version. The difference between open source software and a red queen’s race would be? (That’s a trick question.)
- RSpec 1.1 - A significant release of the latest piece of software that I’m trying to spend quality time with.
- Campfire Notifier for Cruise Control - I’m not actually using either Campfire or Cruise Control anywhere at the moment, but if I was, this would be cool.
- Using Git with SVN - All of a sudden I’m seeing a lot of references to using git for source code control instead of svn. Looks like it’s reasonably possible to bridge the two.
- Updating RubyGems and Rails in Leopard - I wonder if this would cure some of the versionitis I’m having on one of my dev boxes. Probably not, because I think I compiled everything from source on that box in the first place.
- GoogleCharts - I figured someone would wrap up the new Google Charting API in a nice gem for Ruby & Rails. I wasn’t disappointed.
- Using SSH Agent With Mac OS X Leopard - Came in handy for me as I switched over to letting Leopard be my ssh agent.
- Google Maps API Icon Shadowmaker - This is going to come in handy on the site where I’m using Google Maps for a client.
- BitNami - Pre-packaged install stacks for a lot of open source apps across a variety of operating systems. They have a Ruby and Rails package that provides an alternative to Instant Rails. (via Anthony Eden)
- jrubyhub.com - More JRuby resources than you can shake a stick at.
We now return you to our regularly scheduled program of linkage.
- LiquiBase - Open source database refactoring tool that can handle MySQL and PostgreSQL among others.
- Four Words for Microsoft - Tim Bray weighs in on Microsoft’s most recent FUD salvo with reasonable eloquence.
- CodeGear Unveils First IDE for Agile Ruby on Rails Web 2.0 Development - The former Borland IDE team gets into the act by announcing a new cross-platform IDE due to ship the second half of this year. I predict that some people will see this as the beginning of the end for Rails (”Oh no! The barbarians are coming!”)
- ActiveWarehouse 0.3.0 Released - Looks like this OLAP framework for Rails is moving right along.
- Swiftiply - New clustering proxy for Web applications that includes Mongrel support. (via Ruby Inside)
- an introduction to RSpec - Part I - Along with an introduction to BDD in general.
- How to deploy a self contained Rails application on Tomcat, painlessly! - I hope this never happens to me, but if you’re sneaking Rails into the enterprise it may be your only hope. (via Ruby Inside)
- Hi, I’m Ruby on Rails - Lovely little takeoff on those Mac vs. PC ads.
Had to figure out how to rework my Rails login stuff to work with MD5 instead of SHA last night, as MD5 is pretty much the only hashing that LSL supports. Fortunately, this was a simple change despite the alphabet soupness of it all.
- CruiseControl.rb - Continuous integration for Ruby. When my Rails code gets a bit more mature, I must look into this. (via Toolman Tim)
- Describe it with RSpec - The RSpec behavior definition framework is another piece that I really should dig into some day.
- How To Install Zimbra Collaboration Suite (ZCS) On Ubuntu - For a few brief moments I thought about this, but I really don’t need a collaboration server right at the moment. Maybe when I manage to wean the rest of the users on my network off of Exchange this will come in handy.

