<commit_before># encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)

describe "Browser" do

  describe "#exists?" do
    it "returns true if we are at a page" do
      browser.goto(WatirSpec.files + "/non_control_elements.html")
      browser.should exist
    end

    not_compliant_on(:safariwatir) do
      it "returns false after Browser#close" do
        b = WatirSpec.new_browser
        b.close
        b.should_not exist
      end
    end
  end

  # this should be rewritten - the actual string returned varies alot between implementations
  describe "#html" do
    not_compliant_on [:webdriver, :ie] do
      it "returns the DOM of the page as an HTML string" do
        browser.goto(WatirSpec.files + "/right_click.html")
        html = browser.html.downcase # varies between browsers

        html.should =~ /^<html/
        html.should include('<meta content="text/html; charset=utf-8" http-equiv="content-type" />')
      end
    end<commit_msg>changed spec that was failing for safariwatir so it passes now<commit_after># encoding: utf-8
require File.expand_path("../spec_helper", __FILE__)

describe "Browser" do

  describe "#exists?" do
    it "returns true if we are at a page" do
      browser.goto(WatirSpec.files + "/non_control_elements.html")
      browser.should exist
    end

    not_compliant_on(:safariwatir) do
      it "returns false after Browser#close" do
        b = WatirSpec.new_browser
        b.close
        b.should_not exist
      end
    end
  end

  # this should be rewritten - the actual string returned varies alot between implementations
  describe "#html" do
    not_compliant_on [:webdriver, :ie] do
      it "returns the DOM of the page as an HTML string" do
        browser.goto(WatirSpec.files + "/right_click.html")
        html = browser.html.downcase # varies between browsers

        html.should =~ /^<html/
        html.should include('<meta ')
        html.should include(' content="text/html; charset=utf-8"')
        html.should include(' http-equiv="content-type"')
      end
    end
{'fraction_non_alphanumeric': 0.09606986899563319, 'fraction_numerical': 0.0019408054342552159, 'mean_word_length': 2.7904411764705883, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, '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': '5371404', 'n_tokens_mistral': 634, 'n_tokens_neox': 600, 'n_words': 193}