<commit_before>require 'spec_helper'

module Supatagu
  describe 'Taggable' do
    before(:each) do
      @taggable = ::Taggable.create(name: 'A taggable model')
    end

    it 'should respond to taggings' do
      @taggable.should respond_to(:taggings)
    end
    
    it 'should respond to tags' do
      @taggable.should respond_to(:tags)
    end
    
    it 'can be tagged with a CSV string' do
      @taggable.tag_with 'chunky, bacon, ruby, rails'
      @taggable.tag_list.should == ['chunky', 'bacon', 'ruby', 'rails']
    end
    
    describe 'a tagged Taggable' do
      before do
        @taggable.tag_with 'ruby, bacon'
        @ruby = ::Supatagu::Tag.where(name: 'ruby').first
        @bacon = ::Supatagu::Tag.where(name: 'bacon').first
      end
      
      it 'should return its tags' do
        @taggable.tags.should include(@ruby, @bacon)
      end
      
      it 'should return its tags as a csv string' do
        @taggable.delimited_tag_list.should == 'ruby, bacon'
      end
      
      it 'should return its tags as a array of strings' do
        @taggable.tag_list.should == ['ruby', 'bacon']
      end
    end
    
    describe 'Taggable class' do
      before do
        @taggable_1 = ::Taggable.create(name: 'Taggable 1')
        @taggable_2 = ::Taggable.create(name: 'Taggable 2')
        @taggable_3 = ::Taggable.create(name: 'Taggable 3')
        @taggable_1.tag_with 'foo, bar, baz'
        @taggable_2.tag_with 'foo, bar'
        @taggable_3.tag_with 'foo'
      end
      
      it 'should be able to find instances by tag' do
        tag_with_foo = ::Taggable.tagged_with 'foo'
        tag_with_bar = ::Taggable.tagged_with 'bar'
        tag_with_baz = ::Taggable.tagged_with 'baz'
        
        expect(tag_with_foo).to include @taggable_1, @taggable_2, @taggable_3
        expect(tag_with_bar).to include @taggable_1, @taggable_2
        expect(tag_with_baz).to include @taggable_1
      end
    end
  end
end
<commit_msg>Removed quotes around the class name in describe block<commit_after>require 'spec_helper'

module Supatagu
  describe Taggable do
    before(:each) do
      @taggable = ::Taggable.create(name: 'A taggable model')
    end
    
    it { should have_many(:taggings) }
    it { should have_many(:tags) }
    
    it 'can be tagged with a CSV string' do
      @taggable.tag_with 'chunky, bacon, ruby, rails'
      @taggable.tag_list.should == ['chunky', 'bacon', 'ruby', 'rails']
    end
    
    describe 'a tagged Taggable' do
      before do
        @taggable.tag_with 'ruby, bacon'
        @ruby = ::Supatagu::Tag.where(name: 'ruby').first
        @bacon = ::Supatagu::Tag.where(name: 'bacon').first
      end
      
      it 'should return its tags' do
        @taggable.tags.should include(@ruby, @bacon)
      end
      
      it 'should return its tags as a csv string' do
        @taggable.delimited_tag_list.should == 'ruby, bacon'
      end
      
      it 'should return its tags as a array of strings' do
        @taggable.tag_list.should == ['ruby', 'bacon']
      end
    end
    
    describe 'Taggable class' do
      before do
        @taggable_1 = ::Taggable.create(name: 'Taggable 1')
        @taggable_2 = ::Taggable.create(name: 'Taggable 2')
        @taggable_3 = ::Taggable.create(name: 'Taggable 3')
        @taggable_1.tag_with 'foo, bar, baz'
        @taggable_2.tag_with 'foo, bar'
        @taggable_3.tag_with 'foo'
      end
      
      it 'should be able to find instances by tag' do
        tag_with_foo = ::Taggable.tagged_with 'foo'
        tag_with_bar = ::Taggable.tagged_with 'bar'
        tag_with_baz = ::Taggable.tagged_with 'baz'
        
        expect(tag_with_foo).to include @taggable_1, @taggable_2, @taggable_3
        expect(tag_with_bar).to include @taggable_1, @taggable_2
        expect(tag_with_baz).to include @taggable_1
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.10875194199896426, 'fraction_numerical': 0.007767995857068877, 'mean_word_length': 2.4491071428571427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7471138', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1345, 'n_words': 342}