Skip to content

Commit

Permalink
spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
justinko committed Jun 9, 2011
1 parent 78790a2 commit bcfdbe5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions spec/generators/model_generator_spec.rb
Expand Up @@ -6,11 +6,9 @@
describe Rspec::Generators::ModelGenerator do
# Tell the generator where to put its output (what it thinks of as Rails.root)
destination File.expand_path("../../../tmp", __FILE__)
before do
prepare_destination
end

before { prepare_destination }

# using mocks to ensure proper methods are called
it 'should run both the model and fixture tasks' do
gen = generator %w(posts)
gen.should_receive :create_model_spec
Expand All @@ -23,23 +21,30 @@
before do
run_generator %w(posts --fixture)
end

describe 'the spec' do
subject { file('spec/models/posts_spec.rb') }

it { should exist }
it { should contain /require 'spec_helper'/ }
it { should contain /describe Posts/ }
end

describe 'the fixtures' do
subject { file('spec/fixtures/posts.yml') }

it { should contain Regexp.new '# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html' }
end
end

describe 'without fixtures' do
before do
run_generator %w(posts)
end

describe 'the fixtures' do
subject { file('spec/fixtures/posts.yml') }

it { should_not exist }
end
end
Expand Down

0 comments on commit bcfdbe5

Please sign in to comment.