<commit_before># Frozen-string-literal: true
# Copyright: 2012 - 2017 - MIT License
# Encoding: utf-8

require "rspec/helper"
describe "Plugins/Magick" do
  let :asset do
    env.find_asset!("img.png")
  end

  describe "double" do
    let :page do
      jekyll.pages.find do |v|
        v.path == "plugins/magick/double.html"
      end
    end

    it "should double the size" do
      frag = fragment(page.to_s).children.first
      width, height = frag.attr("width"), frag.attr("height")
      dim = FastImage.new(asset.filename)

      expect( width.to_i).to(eq(dim.size.first * 2))
      expect(height.to_i).to(eq(dim.size.last  * 2))
    end
  end

  describe "half" do
    let :page do
      jekyll.pages.find do |v|
        v.path == "plugins/magick/half.html"
      end
    end

    it "should half the size" do
      frag = fragment(page.to_s).children.first
      width, height = frag.attr("width"), frag.attr("height")
      dim = FastImage.new(asset.filename)

      expect( width.to_i).to(eq(dim.size.first / 2))
      expect(height.to_i).to(eq(dim.size.last  / 2))
    end
  end
end<commit_msg>Fix some specs after we changed some stuff.<commit_after># Frozen-string-literal: true
# Copyright: 2012 - 2017 - MIT License
# Encoding: utf-8

require "rspec/helper"
describe "Plugins/Magick" do
  let :asset do
    env.find_asset!("img.png")
  end

  describe "double" do
    let :page do
      jekyll.pages.find do |v|
        v.path == "plugins/magick/double.html"
      end
    end

    it "should double the size" do
      frag = fragment(page.to_s).children.first
      w1, h1 = FastImage.size(env.jekyll.in_dest_dir(frag.attr("src")))
      w2, h2 = FastImage.size(asset.filename)
      expect(w1).to(eq(w2 * 2))
      expect(h1).to(eq(h2 * 2))
    end
  end

  describe "half" do
    let :page do
      jekyll.pages.find do |v|
        v.path == "plugins/magick/half.html"
      end
    end

    it "should half the size" do
      frag = fragment(page.to_s).children.first
      w1, h1 = FastImage.size(env.jekyll.in_dest_dir(frag.attr("src")))
      w2, h2 = FastImage.size(asset.filename)
      expect(w1).to(eq(w2 / 2))
      expect(h1).to(eq(h2 / 2))
    end
  end
end
{'fraction_non_alphanumeric': 0.13744292237442923, 'fraction_numerical': 0.019178082191780823, 'mean_word_length': 2.5168539325842696, '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': '4037859', 'n_tokens_mistral': 827, 'n_tokens_neox': 787, 'n_words': 182}