Sha256: 6c8847ee401a83eea1f0ee64fbd41017bdad54e7353cadf211eea9e83d0d89bd

Contents?: true

Size: 1.28 KB

Versions: 13

Compression:

Stored size: 1.28 KB

Contents

require 'refinerycms-core'
require 'rspec-rails'

module Refinery
  module Testing

    class << self
      attr_accessor :root
      def root
        @root ||= Pathname.new(File.expand_path('../../', __FILE__))
      end
    end

    class Engine < ::Rails::Engine

      initializer "serve static assets" do |app|
        app.middleware.insert_after ::ActionDispatch::Static, ::ActionDispatch::Static, "#{root}/public"
      end

      config.before_configuration do
        ::Refinery::Application.module_eval do
          def load_tasks
            super

            # To get specs from all Refinery engines, not just those in Rails.root/spec/
            ::RSpec::Core::RakeTask.module_eval do
              def pattern
                [@pattern] | ::Refinery::Plugins.registered.pathnames.map{|p|
                               p.join('spec', '**', '*_spec.rb').to_s
                             }
              end
            end if defined?(::RSpec::Core::RakeTask)
          end
        end
      end

      config.after_initialize do
        ::Refinery::Plugin.register do |plugin|
          plugin.name = "refinerycms_testing_plugin"
          plugin.version = ::Refinery.version
          plugin.hide_from_menu = true
        end
      end
    end

  end
end

::Refinery.engines << 'testing'

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
refinerycms-testing-0.9.9.20 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.19 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.18 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.17 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.16 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.15 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.14 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.13 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.12 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.11 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.10 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.9 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.8 lib/refinerycms-testing.rb