Developmentastic

  1. Cucumber Features In Subdirectories

    I’m working on a project where we’ve amassed a decent amount of Cucumber features. Dumping them in the root directory makes it difficult to find the feature you’re looking for and running related features is impossible.

    I’ve fooled with organizing my cucumber features in the past, but didn’t have much luck. Grouping related features into subdirectories was fine when running the entire suite, but running an individual feature failed because Cucumber doesn’t know to load step definitions from the parent directory. As I was looking through cucumber --help the other day, I happened to notice the --require flag.

    -r, --require LIBRARY|DIR
        Require files before executing the features.

    Running the following command was exactly what I needed.

    cucumber --require features features/users/sign_in.feature

    This tells Cucumber to load all .rb files under features/ which will find the step definitions and support files. To save some typing, I created an alias in ~/.bashrc.

    alias cuc='cucumber -r features'

    Where I’ve really enjoyed this setup is when running all related features. After touching a step definition, I’d like to run the features that depend on it quickly without running the entire suite. Now that’s as simple as:

    cuc features/users/*
  2. MongoMapper Looks Promising

    I’ve been intrigued by schema-free document-oriented databases after tinkering with CouchDB, but haven’t found a way to integrate it into my current projects. I’ve heard John Nunemaker sing the praises of MongoDB in the past and today he has officially released his ActiveRecored inspired database adapter MongoMapper.

    It’s got validations, callbacks, a robust find API, support for easily embedding models, and much more. The code looks almost too good to be true.

    class Person
      include MongoMapper::Document
    
      key :first_name, String
      key :last_name, String
      key :age, Integer
      key :born_at, Time
      key :active, Boolean
      key :fav_colors, Array
    end
    

    I hope this project becomes a huge success in the Rails community.

  3. my_blog.refresh

    Not a visual refresh–although the design was rebuilt using Sass and the Blueprint CSS framework with the help of the amazing Compass project (Chris Eppstein, you rock. Seriously.)–but more of a purpose refresh. It’s apparent I’m not able to write long-winded blog posts with any level of consistency, but I have no trouble tweeting 0.62 times daily. I’ll attempt to strike a balance somewhere between and hope for the best.

    Part of the problem can be attributed to coding my own blog. It was my first deployed Rails project and I thoroughly enjoyed the experience, but I soon realized I have no desire whatsoever in maintaining the code base. I’ve been keeping my eye on Jekyll for a while and with the release of GitHub Pages I think it’s about time I make the switch. I’m still undecided how I feel about the dynamic content on the site having to be loaded ajaxily, but with any luck I’ll manage to get over it.