Sha256: 1faa748b274a9abd8bbb3289e821eec785d3936926e2bd9ee8e4eec1b86a22ea
Contents?: true
Size: 1.1 KB
Versions: 7
Compression:
Stored size: 1.1 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') require_generator :observer module RSpec::Core class ExampleGroup include RSpec::Rails::Observer end end describe 'observer_generator' do before :each do setup_generator 'observer_generator' do tests ObserverGenerator end remove_observer 'account' end after :each do remove_observer 'account' end it "should not work without an Account observer file" do with_generator do |g| name = 'account' g.run_generator [name] g.should_not generate_observer name end end it "should decorate an existing Account observer file with a 'observe_me' method" do with_generator do |g| name = 'account' create_observer name do '# observer content' end g.run_generator [name] g.should generate_observer name do |content| content.should have_observer_class name do |klass| klass.should have_method :observe_me end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems