Posts tagged as:

rspec

You can get the video version of this podcast here.

David Heinemeier Hansson sparked a debate on Twitter about Ruby testing frameworks. A lot of people saw it as slamming RSpec and others saw it as constructive conversation about what tools you use and why. This is how I view to see it and where I come down on this debate.

I also discuss why we have these debates in general and what we can learn from them.

{ 6 comments }

In this installment in the Delicious Clone, we use CanCan to set some permissions on the Bookmarks Controller.

Next week, we’ll finish the bookmark creation process and the following, we’ll add styling with SASS.

Download 133.9 MB
Download (iPhone & iPod) 55.9 MB

{ 8 comments }

This week’s podcast guest is Evan Light. I met Evan at the Ruby|Web Conference at Snowbird. He’s responsible for Coulda and the Ruby DCamp.

Evan recommended Get Clients Now!(TM): A 28-Day Marketing Program for Professionals, Consultants, and Coaches (affiliate link) for marketing as a freelancer.

We talked about organizing a conference and what it takes.

He also had some great suggestions for people thinking about switching to freelance.

I also found his discussion of why he wrote Coulda very interesting. It inspires me to think that if I want something different, I can create it.

If you’re looking for a way to increase readability of your code, look at flog or metric_fu.

Jake Scruggs’ talk at Lone Star Ruby Conference 2008

Next month I’ll be teaching a Basic Ruby on Rails course. Go check it out and sign up.

Download this Episode

{ 1 comment }

Because I’m going to be testing in cucumber sections of the site that require a user to be logged in, I decided to get it out of the way. So, in this video, I write a cucumber feature to test login and round it off with a few tests on the devise generated user model to make sure it continues to behave as I expect it to as I update it throughout the process of building this application.

Download 191.8 MB
Download (iPhone & iPod) 87.2 MB

{ 41 comments }

Here is what I’ve done to create this application:

  1. Use the ‘rails new’ command to create a rails application
  2. Set up the Gemfile
  3. Configure the Database
  4. Install Cucumber
  5. Install Rspec
  6. Install Devise
  7. Install CanCan
  8. Install jQuery
  9. Configure Devise

Download (HD) 84.2 MB
Download (iPod & iPhone) 47.4 MB

{ 37 comments }

I was setting up a new project/gem that interfaces with Project Honeypot. While I was setting it up, I ran into a couple of problems running my specs. The first one, I hit this error while running ‘bundle exec spec spec’:

/usr/local/lib/ruby/gems/1.8/gems/bundler-1.0.2/lib/bundler/shared_helpers.rb:137:in `bin_path': can't find executable spec (Gem::Exception)
	from /usr/local/bin/spec:19

What this means is that the spec gem doesn’t have an executable called ‘spec.’ This confused me since all of the previous versions had been run with a ‘spec’ command. As it turns out, in RSpec 2.0.x, the command to run your specs is ‘rspec,’ not ‘spec.’ So a ‘bundle exec rspec spec’ got around that error.

The next issue I got was an undefined constant error for ‘Spec::Runner.’ Here is my spec_helper where I was referencing Spec::Runner.

require "rubygems"
require "bundler/setup"
require "rspec"
require "flexmock"
require File.dirname(__FILE__) + "/../lib/project_honeypot"

Spec::Runner.configure do |config|
  config.mock_with :flexmock
end

So, RSpec has changed the configuration setup to use RSpec instead of Spec::Runner and it worked like a charm.

You can check out the respository I was working in at http://github.com/charlesmaxwood/project_honeypot.

{ 0 comments }


Every good project needs a good setup. In this episode, I set up a github repo, create a new rails application, hook in Cucumber and Rspec, write a Cucumber feature, and write the code to make it pass.
Download 142 MB
Download (iphone & ipod) 59 MB

{ 27 comments }


RSpec gives us many powerful tools to make our tests readable. Matchers allow us to provide custom predicates to our should statements that succinctly define the behavior of our code.
Download 27 MB
Download (iphone & ipod) 14 MB

{ 6 comments }


RSpec provides an extremely concise way of representing simple tests to be called on new instances of a class or on explicitly defined receiver objects. You can do this by using ‘subjects’ either as defined by the ‘describe’ or the ‘subject’ methods.
Download 38 MB
Download (iphone & ipod) 18.2 MB

{ 12 comments }

Test Driven Development and Behavior Driven Development can be terrific tools in defining your code and ensuring the highest quailty software. In this episode, we discuss the differences between TDD and BDD and what the advantages are to doing them.

We also talk about these test tools:

Download this Episode

{ 2 comments }