Sha256: adb225e766337bce7e6ed67235cef00fd0bc4f69c524d64c85bfb74dc38a0d40

Contents?: true

Size: 1.11 KB

Versions: 6

Compression:

Stored size: 1.11 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
      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

6 entries across 6 versions & 1 rubygems

Version Path
refinerycms-testing-0.9.9.7 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.5 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.4 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.3 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.2 lib/refinerycms-testing.rb
refinerycms-testing-0.9.9.1 lib/refinerycms-testing.rb