<commit_before>require 'spec_helper'

module Refinery
  module RefineryRspec
    class Engine < ::Rails::Engine
      isolate_namespace ::Refinery
      ::Refinery::Plugin.register do |plugin|
        plugin.name = 'refinery_rspec'
        plugin.hide_from_menu = true
      end
    end
  end
end

module Refinery
  describe Plugin do

    let(:plugin) { ::Refinery::Plugins.registered.detect { |plugin| plugin.name == 'refinery_rspec' } }

    def setup_i18n
      ::I18n.backend = ::I18n::Backend::Simple.new
      ::I18n.backend.store_translations :en, :refinery => {
        :plugins => {
          :refinery_rspec => {
            :title => 'RefineryCMS RSpec',
            :description => 'RSpec tests for plugin.rb'
          }
        }
      }
    end

    describe '.register' do
      it 'must have a name' do
        lambda { Plugin.register {} }.should raise_error
      end
    end

    describe '#class_name' do
      it 'returns class name' do
        plugin.class_name.should == 'RefineryRspec'
      end
    end

    describe '#title' do
      before { setup_i18n }

      it 'returns plugin title defined by I18n' do
        plugin.title.should == 'RefineryCMS RSpec'
      end
    end

    describe '#description' do
      before { setup_i18n }

      it 'returns plugin description defined by I18n' do
        plugin.description.should == 'RSpec tests for plugin.rb'
      end
    end<commit_msg>Mark spec as pending because it's way too slow. Will fix asap.<commit_after>require 'spec_helper'

module Refinery
  module RefineryRspec
    class Engine < ::Rails::Engine
      isolate_namespace ::Refinery
      ::Refinery::Plugin.register do |plugin|
        plugin.name = 'refinery_rspec'
        plugin.hide_from_menu = true
      end
    end
  end
end

module Refinery
  describe Plugin do

    let(:plugin) { ::Refinery::Plugins.registered.detect { |plugin| plugin.name == 'refinery_rspec' } }

    def setup_i18n
      ::I18n.backend = ::I18n::Backend::Simple.new
      ::I18n.backend.store_translations :en, :refinery => {
        :plugins => {
          :refinery_rspec => {
            :title => 'RefineryCMS RSpec',
            :description => 'RSpec tests for plugin.rb'
          }
        }
      }
    end

    describe '.register' do
      it 'must have a name' do
        lambda { Plugin.register {} }.should raise_error
      end
    end

    describe '#class_name' do
      it 'returns class name' do
        plugin.class_name.should == 'RefineryRspec'
      end
    end

    describe '#title' do
      pending "spec is way too slow... fix asap"
      # before { setup_i18n }

      # it 'returns plugin title defined by I18n' do
      #   plugin.title.should == 'RefineryCMS RSpec'
      # end
    end

    describe '#description' do
      pending "spec is way too slow... fix asap"
      # before { setup_i18n }

      # it 'returns plugin description defined by I18n' do
      #   plugin.description.should == 'RSpec tests for plugin.rb'
      # end
    end
{'fraction_non_alphanumeric': 0.0990990990990991, 'fraction_numerical': 0.010677344010677344, 'mean_word_length': 2.230603448275862, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6871785', 'n_tokens_mistral': 940, 'n_tokens_neox': 898, 'n_words': 256}