<commit_before>require 'spec_helper'
require 'helpers/examples'

require 'yard-dm/has_handler'
require 'yard-dm/legacy/has_handler'

describe "HasHandler" do
  include Helpers::Examples

  describe "has n" do
    before(:all) do
      parse_file :has_n
    end

    it "should define class-methods for the 'has n' relationships" do
      yard('HasN.things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define reader methods for the 'has n' relationships" do
      yard('HasN#things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define writer methods for the 'has n' relationships" do
      yard('HasN#things=').should be_instance_of(CodeObjects::MethodObject)
    end
  end

  describe "has 0" do
    before(:all) do
      parse_file :has_zero
    end

    it "should define class-methods for the 'has 0' relationships" do
      yard('HasZero.things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define reader methods for the 'has 0' relationships" do
      yard('HasZero#things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define writer methods for the 'has 0' relationships" do
      yard('HasZero#things=').should be_instance_of(CodeObjects::MethodObject)
    end
  end

  describe "has 1" do
    before(:all) do
      parse_file :has_zero
    end

    it "should define class-methods for the 'has 1' relationships" do
      yard('HasOne.things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define reader methods for the 'has 1' relationships" do
      yard('HasOne#things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define writer methods for the 'has 1' relationships" do
      yard('HasOne#things=').should be_instance_of(CodeObjects::MethodObject)
    end
  end

  describe "has 0..n" do
    before(:all) do
      parse_file :has_zero_to_n
    end

    it "should define class-methods for the 'has 0..n' relationships" do
      yard('HasZeroToN.things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define reader methods for the 'has 0..n' relationships" do
      yard('HasZeroToN#things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define writer methods for the 'has 0..n' relationships" do
      yard('HasZeroToN#things=').should be_instance_of(CodeObjects::MethodObject)
    end
  end

  describe "has 1..n" do
    before(:all) do
      parse_file :has_one_to_n
    end

    it "should define class-methods for the 'has 1..n' relationships" do
      yard('HasOneToN.things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define reader methods for the 'has 1..n' relationships" do
      yard('HasOneToN#things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define writer methods for the 'has 1..n' relationships" do
      yard('HasOneToN#things=').should be_instance_of(CodeObjects::MethodObject)
    end
  end
end
<commit_msg>Fixed the "has 1" specs.<commit_after>require 'spec_helper'
require 'helpers/examples'

require 'yard-dm/has_handler'
require 'yard-dm/legacy/has_handler'

describe "HasHandler" do
  include Helpers::Examples

  describe "has n" do
    before(:all) do
      parse_file :has_n
    end

    it "should define class-methods for the 'has n' relationships" do
      yard('HasN.things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define reader methods for the 'has n' relationships" do
      yard('HasN#things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define writer methods for the 'has n' relationships" do
      yard('HasN#things=').should be_instance_of(CodeObjects::MethodObject)
    end
  end

  describe "has 0" do
    before(:all) do
      parse_file :has_zero
    end

    it "should define class-methods for the 'has 0' relationships" do
      yard('HasZero.things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define reader methods for the 'has 0' relationships" do
      yard('HasZero#things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define writer methods for the 'has 0' relationships" do
      yard('HasZero#things=').should be_instance_of(CodeObjects::MethodObject)
    end
  end

  describe "has 1" do
    before(:all) do
      parse_file :has_one
    end

    it "should define class-methods for the 'has 1' relationships" do
      yard('HasOne.things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define reader methods for the 'has 1' relationships" do
      yard('HasOne#things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define writer methods for the 'has 1' relationships" do
      yard('HasOne#things=').should be_instance_of(CodeObjects::MethodObject)
    end
  end

  describe "has 0..n" do
    before(:all) do
      parse_file :has_zero_to_n
    end

    it "should define class-methods for the 'has 0..n' relationships" do
      yard('HasZeroToN.things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define reader methods for the 'has 0..n' relationships" do
      yard('HasZeroToN#things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define writer methods for the 'has 0..n' relationships" do
      yard('HasZeroToN#things=').should be_instance_of(CodeObjects::MethodObject)
    end
  end

  describe "has 1..n" do
    before(:all) do
      parse_file :has_one_to_n
    end

    it "should define class-methods for the 'has 1..n' relationships" do
      yard('HasOneToN.things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define reader methods for the 'has 1..n' relationships" do
      yard('HasOneToN#things').should be_instance_of(CodeObjects::MethodObject)
    end

    it "should define writer methods for the 'has 1..n' relationships" do
      yard('HasOneToN#things=').should be_instance_of(CodeObjects::MethodObject)
    end
  end
end

{'fraction_non_alphanumeric': 0.09521452145214522, 'fraction_numerical': 0.005445544554455445, 'mean_word_length': 3.713063763608087, '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': '2610113', 'n_tokens_mistral': 1899, 'n_tokens_neox': 1790, 'n_words': 542}