<commit_before># encoding: utf-8

require 'spec_helper'

describe Github::Client::Issues::Comments, '#get' do
  let(:user)   { 'peter-murach' }
  let(:repo)   { 'github' }
  let!(:comment_id) { 1 }
  let(:request_path) { "/repos/#{user}/#{repo}/issues/#{comment_id}/comments" }

  before {
    stub_get(request_path).to_return(:body => body, :status => status,
      :headers => {:content_type => "application/json; charset=utf-8"})
  }

  after { reset_authentication_for(subject) }

  context "resource found" do
    let(:body) { fixture('issues/comment.json') }
    let(:status) { 200 }

    it { should respond_to :find }

    it "should fail to get resource without comment id" do
      expect { subject.get user, repo, nil }.to raise_error(ArgumentError)
    end

    it "should get the resource" do
      subject.get user, repo, comment_id
      a_get(request_path).should have_been_made
    end

    it "should get comment information" do
      comment = subject.get user, repo, comment_id
      comment.user.id.should == comment_id
      comment.user.login.should == 'octocat'
    end<commit_msg>Fix spec.<commit_after># encoding: utf-8

require 'spec_helper'

describe Github::Client::Issues::Comments, '#get' do
  let(:user)   { 'peter-murach' }
  let(:repo)   { 'github' }
  let!(:comment_id) { 1 }
  let(:request_path) { "/repos/#{user}/#{repo}/issues/comments/#{comment_id}" }

  before {
    stub_get(request_path).to_return(:body => body, :status => status,
      :headers => {:content_type => "application/json; charset=utf-8"})
  }

  after { reset_authentication_for(subject) }

  context "resource found" do
    let(:body) { fixture('issues/comment.json') }
    let(:status) { 200 }

    it { should respond_to :find }

    it "should fail to get resource without comment id" do
      expect { subject.get user, repo, nil }.to raise_error(ArgumentError)
    end

    it "should get the resource" do
      subject.get user, repo, comment_id
      a_get(request_path).should have_been_made
    end

    it "should get comment information" do
      comment = subject.get user, repo, comment_id
      comment.user.id.should == comment_id
      comment.user.login.should == 'octocat'
    end
{'fraction_non_alphanumeric': 0.1373526745240254, 'fraction_numerical': 0.005439709882139619, 'mean_word_length': 3.4406438631790746, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '6978629', 'n_tokens_mistral': 742, 'n_tokens_neox': 707, 'n_words': 174}