Sha256: 54a2885c406807bba0e4c5531b5072c997cd1ded6d31c3b13da651993a5370ec
Contents?: true
Size: 1.16 KB
Versions: 41
Compression:
Stored size: 1.16 KB
Contents
require 'rubygems' require 'ruby-debug' require 'active_support' require 'active_record' require 'action_controller' require 'action_view' require 'shoulda' require 'mocha' require File.join(File.dirname(__FILE__), 'shoulda_macros', 'generator_macros') require File.join(File.dirname(__FILE__), 'stolen_from_railties') unless defined?(RAILS_DEFAULT_LOGGER) @test_log = File.join(RAILS_ROOT, 'test.log') RAILS_DEFAULT_LOGGER = Logger.new(@test_log) end Rails::Generator::Base.prepend_sources Rails::Generator::PathSource.new(:shoulda_generator, File.join(File.dirname(__FILE__), "..", "rails_generators")) class GeneratorTestCase # Asserts that the given factory was created. def assert_generated_factory_for(name) assert_generated_file "test/factories/#{name.to_s.underscore}_factory.rb" end # Asserts that the given factory was NOT created. def deny_generated_factory_for(name) deny_file_exists "test/factories/#{name.to_s.underscore}_factory.rb" end # asserts that the given file DOES NOT exists def deny_file_exists(path) assert ! File.exist?("#{RAILS_ROOT}/#{path}"), "The file '#{RAILS_ROOT}/#{path}' should not exist" end end
Version data entries
41 entries across 41 versions & 14 rubygems