<commit_before>require 'spec_helper'

describe Jekyll::S3::Uploader do
  describe 'content type resolving' do
    it 'adds the content type of the uploaded CSS file into the S3 object' do
      file_to_upload = 'css/styles.css'
      Jekyll::S3::Uploader.send(:upload_file,
                                file_to_upload,
                                create_content_type_verifying_s3(file_to_upload),
                                'some_bucket_name',
                                'features/support/test_site_dirs/my.blog.com/_site')
    end

    it 'adds the content type of the uploaded HTML file into the S3 object' do
      file_to_upload = 'index.html'
      Jekyll::S3::Uploader.send(:upload_file,
                                file_to_upload,
                                create_content_type_verifying_s3(file_to_upload),
                                'some_bucket_name',
                                'features/support/test_site_dirs/my.blog.com/_site')
    end

    def create_content_type_verifying_s3(file_to_upload)
      def create_objects(file_to_upload)
        def create_html_s3_object(file_to_upload)
          s3_object = stub('s3_object')
          content_type = (file_to_upload.end_with?'html') ? 'text/html' : 'text/css'
          s3_object.should_receive(:write).with(
            anything(),
            # Ensure that the write method is called with the correct content type:
            :content_type => content_type
          )
          s3_object
        end
        objects = {}
        objects[file_to_upload] = create_html_s3_object(file_to_upload)
        objects
      end
      def create_bucket(file_to_upload)
        bucket = stub('bucket')
        bucket.stub(:objects => create_objects(file_to_upload))
        bucket
      end
      buckets = stub('buckets')
      buckets.stub(:[] => create_bucket(file_to_upload))
      s3 = stub('s3')
      s3.stub(:buckets => buckets)
      s3
    end
  end
end
<commit_msg>Fix spec by adding missing param s3_rss<commit_after>require 'spec_helper'

describe Jekyll::S3::Uploader do
  describe 'content type resolving' do
    it 'adds the content type of the uploaded CSS file into the S3 object' do
      file_to_upload = 'css/styles.css'
      Jekyll::S3::Uploader.send(:upload_file,
                                file_to_upload,
                                create_content_type_verifying_s3(file_to_upload),
                                'some_bucket_name',
                                'features/support/test_site_dirs/my.blog.com/_site',
                                s3_rrs = false)
    end

    it 'adds the content type of the uploaded HTML file into the S3 object' do
      file_to_upload = 'index.html'
      Jekyll::S3::Uploader.send(:upload_file,
                                file_to_upload,
                                create_content_type_verifying_s3(file_to_upload),
                                'some_bucket_name',
                                'features/support/test_site_dirs/my.blog.com/_site',
                                s3_rrs = false)
    end

    def create_content_type_verifying_s3(file_to_upload)
      def create_objects(file_to_upload)
        def create_html_s3_object(file_to_upload)
          s3_object = stub('s3_object')
          content_type = (file_to_upload.end_with?'html') ? 'text/html' : 'text/css'
          s3_object.should_receive(:write).with(
            anything(),
            # Ensure that the write method is called with the correct content type:
            :content_type => content_type,
            :reduced_redundancy => false
          )
          s3_object
        end
        objects = {}
        objects[file_to_upload] = create_html_s3_object(file_to_upload)
        objects
      end
      def create_bucket(file_to_upload)
        bucket = stub('bucket')
        bucket.stub(:objects => create_objects(file_to_upload))
        bucket
      end
      buckets = stub('buckets')
      buckets.stub(:[] => create_bucket(file_to_upload))
      s3 = stub('s3')
      s3.stub(:buckets => buckets)
      s3
    end
  end
end

{'fraction_non_alphanumeric': 0.08097560975609756, 'fraction_numerical': 0.00951219512195122, 'mean_word_length': 1.8678321678321679, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, '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': '6055263', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1198, 'n_words': 234}