<commit_before>require_relative('./spec_helper')
 
describe Zemus do

  it "accepts test for images" do
    url = "www.google.com/sample.gif"
    Zemus.embed(url).should == "<img src='www.google.com/sample.gif' class='img-responsive img-thumbnail' />"
  
    url = 'http://play-mario-onlne.com/old-school-mario.png'
    Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.png' class='img-responsive img-thumbnail' />"

    url = 'http://play-mario-onlne.com/old-school-mario.jpg'
    Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.jpg' class='img-responsive img-thumbnail' />"

    url = 'http://play-mario-onlne.com/old-school-mario.jpeg'
    Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.jpeg' class='img-responsive img-thumbnail' />"
  
    url = 'http://play-mario-onlne.com/old-school-mario.GIF'
    Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.GIF' class='img-responsive img-thumbnail' />"
  end

  it "acceptance tests for (kick start) starter" do
    [
      "youtube.com/watch?v=Ai7pMPCDHpo", "youtu.be/Ai7pMPCDHpo",
      "youtube.com/embed/Ai7pMPCDHpo", "youtube.com/watch?feature=player_embedded&v=Ai7pMPCDHpo",
      "youtube.com/watch?v=Ai7pMPCDHpo&feature=player_embedded",
      "youtube.com/watch?v=Ai7pMPCDHpo&feature=youtu.be&hd", "m.youtube.com/#/watch?client=mv-google&gl=US&v=Ai7pMPCDHpo&oref=http%3A%2F%2Fm.youtube.com%2F"
    ].each do |url_format|
      [ "", "http://", "http://www.", "https://", "https://www." ].each do |subdomain|
        url = "#{subdomain}#{url_format}"

        Zemus.embed(url).should eq("<iframe width='100%' height='600px' src='http://www.youtube.com/embed/Ai7pMPCDHpo?wmode=opaque' frameborder='0' allowfullscreen></iframe>")
      end
    end<commit_msg>Fixing up the images tests<commit_after>require_relative('./spec_helper')
 
describe Zemus do

  it "accepts test for images" do
    url = "www.google.com/sample.gif"
    Zemus.embed(url).should == "<img src='www.google.com/sample.gif' class='img-responsive img-thumbnail' alt='www.google.com/sample.gif' />"
  
    url = 'http://play-mario-onlne.com/old-school-mario.png'
    Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.png' class='img-responsive img-thumbnail' alt='http://play-mario-onlne.com/old-school-mario.png' />"

    url = 'http://play-mario-onlne.com/old-school-mario.jpg'
    Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.jpg' class='img-responsive img-thumbnail' alt='http://play-mario-onlne.com/old-school-mario.jpg' />"

    url = 'http://play-mario-onlne.com/old-school-mario.jpeg'
    Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.jpeg' class='img-responsive img-thumbnail' alt='http://play-mario-onlne.com/old-school-mario.jpeg' />"
  
    url = 'http://play-mario-onlne.com/old-school-mario.GIF'
    Zemus.embed(url).should == "<img src='http://play-mario-onlne.com/old-school-mario.GIF' class='img-responsive img-thumbnail' alt='http://play-mario-onlne.com/old-school-mario.GIF' />"
  end

  it "acceptance tests for (kick start) starter" do
    [
      "youtube.com/watch?v=Ai7pMPCDHpo", "youtu.be/Ai7pMPCDHpo",
      "youtube.com/embed/Ai7pMPCDHpo", "youtube.com/watch?feature=player_embedded&v=Ai7pMPCDHpo",
      "youtube.com/watch?v=Ai7pMPCDHpo&feature=player_embedded",
      "youtube.com/watch?v=Ai7pMPCDHpo&feature=youtu.be&hd", "m.youtube.com/#/watch?client=mv-google&gl=US&v=Ai7pMPCDHpo&oref=http%3A%2F%2Fm.youtube.com%2F"
    ].each do |url_format|
      [ "", "http://", "http://www.", "https://", "https://www." ].each do |subdomain|
        url = "#{subdomain}#{url_format}"

        Zemus.embed(url).should eq("<iframe width='100%' height='600px' src='http://www.youtube.com/embed/Ai7pMPCDHpo?wmode=opaque' frameborder='0' allowfullscreen></iframe>")
      end
    end
{'fraction_non_alphanumeric': 0.19843671205244579, 'fraction_numerical': 0.009581442259203227, 'mean_word_length': 3.996221662468514, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 4, 'lorem ipsum': 0, 'www.': 11, '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': '1633573', 'n_tokens_mistral': 1622, 'n_tokens_neox': 1580, 'n_words': 172}