<commit_before>require 'spec_helper'

describe Yardstick::Rule, '#enabled?' do
  subject { described_class.new(document, options).enabled? }

  let(:document) { mock('document', path: 'Foo#bar') }
  let(:options)  { {}                                }

  context 'when no options' do
    it { should be(true) }
  end

  context 'when disabled' do
    before { options[:enabled] = false }

    it { should be(false) }
  end

  context 'when current method is excluded' do
    before { options[:exclude] = ['Foo#bar'] }

    it { should be(false) }
  end
end<commit_msg>Use ruby 1.8 hash syntax everywhere<commit_after>require 'spec_helper'

describe Yardstick::Rule, '#enabled?' do
  subject { described_class.new(document, options).enabled? }

  let(:document) { mock('document', :path => 'Foo#bar') }
  let(:options)  { {}                                }

  context 'when no options' do
    it { should be(true) }
  end

  context 'when disabled' do
    before { options[:enabled] = false }

    it { should be(false) }
  end

  context 'when current method is excluded' do
    before { options[:exclude] = ['Foo#bar'] }

    it { should be(false) }
  end
end
{'fraction_non_alphanumeric': 0.1335055986218777, 'fraction_numerical': 0.0017226528854435831, 'mean_word_length': 2.8733333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '523967', 'n_tokens_mistral': 373, 'n_tokens_neox': 346, 'n_words': 102}