Sha256: f1d9d4b2d6dbf77a66345290309831d03a10c4c757579347a20ba95559925859

Contents?: true

Size: 858 Bytes

Versions: 10

Compression:

Stored size: 858 Bytes

Contents

module RSpec::Generator
  module Macro  
    def with_generator &block
      RSpec::Generator.with_generator &block
    end

    def setup_generator test_method_name=nil, &block
      RSpec::Generator.setup_generator test_method_name, &block
    end 
    
    def create_rails_app app_name = nil
      app_name ||= 'rails_app'
      Dir.mkdir ::TmpRails.root if !File.directory?(::TmpRails.root)
      Dir.chdir ::TmpRails.root do
        FileUtils.rm_rf app_name
        %x[rails new #{app_name} --force]
      end
    end

    def remove_rails_app app_name = nil
      app_name ||= 'rails_app'
      Dir.mkdir ::TmpRails.root if !File.directory?(::TmpRails.root)
      Dir.chdir ::TmpRails.root do      
        FileUtils.rm_rf app_name
      end
    end    
  end
end

module RSpec::Core
  class ExampleGroup
    extend RSpec::Generator::Macro
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
generator-spec-0.7.8 lib/generator-spec/rspec/macro.rb
generator-spec-0.7.6 lib/generator-spec/rspec/macro.rb
generator-spec-0.7.5 lib/generator-spec/rspec/macro.rb
generator-spec-0.7.4 lib/generator-spec/rspec/macro.rb
generator-spec-0.7.2 lib/generator-spec/rspec/macro.rb
generator-spec-0.7.1 lib/generator-spec/rspec/macro.rb
generator-spec-0.7.0 lib/generator-spec/rspec/macro.rb
generator-spec-0.6.6 lib/generator-spec/rspec/macro.rb
generator-spec-0.6.5 lib/generator-spec/rspec/macro.rb
generator-spec-0.6.4 lib/generator-spec/rspec/macro.rb