Experimenting with converting Rails::Generators::TestCase to RSpec 2

Example:

require File.expand_path(File.dirname(FILE) + ‘/…/spec_helper’)

describe ‘Generator’ do
let(:generator) { Rails::Generators::Testcase.new }

with generator do
destination File.join(Rails.root)
tests Canable::Generators::ModelGenerator
setup :prepare_destination
setup :copy_routes
end

it “should work”
generator.run_generator
generator.should generate_file(‘app/models/hello.rb’)
end
end

What do you think?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs