<commit_before>require 'spec_helper'

describe Muddle::Interceptor do
  before(:each) do
    Muddle::Parser.stub!(:parse) { 'muddled email body' }
  end

  subject { Muddle::Interceptor }

  context "with a multi-part email" do
    let(:email) { multi_part_email }

    it "muddles the html part" do
      subject.delivering_email(email).html_part.body.should == 'muddled email body'
      subject.delivering_email(email).text_part.body.should == 'Muddle is pretty cool'
    end
  end

  context "with a single-part email" do
    let(:email) { html_email }

    it "muddles the email body" do
      subject.delivering_email(email).body.should == 'muddled email body'
    end
  end

  context "with a single-part plaintext email" do
    let(:email) { plaintext_email }

    it "doesn't muddle the email body" do
      subject.delivering_email(email).body.should == 'Muddle is pretty cool'<commit_msg>Testig current functioality. Fialing test for plaintext emails.<commit_after>require 'spec_helper'

describe Muddle::Interceptor do
  before(:each) do
    Muddle::Parser.stub!(:parse) { 'muddled email body' }
  end

  subject { Muddle::Interceptor }

  context "with a multi-part email" do
    let(:email) { multi_part_email }

    it "muddles the html part" do
      subject.delivering_email(email).html_part.body.should == 'muddled email body'
      subject.delivering_email(email).text_part.body.to_s.should == 'Muddle is pretty cool.'
    end
  end

  context "with a single-part email" do
    let(:email) { html_email }

    it "muddles the email body" do
      subject.delivering_email(email).body.should == 'muddled email body'
    end
  end

  context "with a single-part plaintext email" do
    let(:email) { plaintext_email }

    it "doesn't muddle the email body" do
      subject.delivering_email(email).body.to_s.should == 'Muddle is pretty cool.'
{'fraction_non_alphanumeric': 0.1043010752688172, 'fraction_numerical': 0.0, 'mean_word_length': 3.6064356435643563, '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': '3794757', 'n_tokens_mistral': 630, 'n_tokens_neox': 585, 'n_words': 166}