This should use the short-syntax version, particularly because in newer versions of rspec, direct references to the subject are a no-go.
eg:

    subject(:factory) { CommandFactory.new nil }
    describe 'building a command' do
      subject { factory.command(:foo) }
      it { should be_a Command }
    end

    describe "building a command from a key" do
      let(:key) { :q }
      subject { factory.command(key) }

      it { should be_a QuitCommand }
    end


Also be wary of `be_a` in tests, you're better off testing what methods/api it supports than what class it is. This makes your tests less brittle wrt to renaming and also opens up a lot of possibilities to share testing code in the form of shared examples, a la


    shared_examples_for 'a command' do
      it { should respond_to :execute }
      it { should respond_to :unexecute }
      # etc
    end

    # ... 

    describe QuitCommand do
      it_should_behave_like "a command"
      # other tests relating to QuitCommand-specific behavior
    end