<commit_before># encoding: utf-8

require 'spec_helper'

describe Function::Binary::Invertible, '#inverse' do
  subject { object.inverse }

  let(:described_class) { Class.new(Function) { include Function::Binary } }
  let(:left)            { mock('Left').freeze                              }
  let(:right)           { mock('Right').freeze                             }
  let(:object)          { described_class.new(left, right)                 }

  before do
    described_class.class_eval do
      include Function::Binary::Invertible

      def self.inverse
        self
      end

      def inspect
        'Binary::Invertible'
      end
    end
  end

  it_should_behave_like 'an invertible method'

  it { should be_instance_of(described_class) }<commit_msg>Fix spec to kill mutation in Function::Binary::Invertible#inverse<commit_after># encoding: utf-8

require 'spec_helper'

describe Function::Binary::Invertible, '#inverse' do
  subject { object.inverse }

  let(:described_class) { Class.new(Function) { include Function::Binary } }
  let(:left)            { mock('Left').freeze                              }
  let(:right)           { mock('Right').freeze                             }
  let(:object)          { described_class.new(left, right)                 }

  let(:inverse_class) do
    Class.new(Function) do
      include Function::Binary::Invertible, Function::Binary
    end
  end

 before do
    described_class.class_eval do
      include Function::Binary::Invertible

      def self.inverse
        InverseClass
      end

      def inspect
        'Binary::Invertible'
      end
    end
  end

  before do
    ::InverseClass = inverse_class
  end

  after do
    Object.send(:remove_const, :InverseClass) if defined?(InverseClass)
  end

  it_should_behave_like 'an invertible method'

  it { should be_instance_of(InverseClass) }
{'fraction_non_alphanumeric': 0.09795479009687837, 'fraction_numerical': 0.001076426264800861, 'mean_word_length': 2.2902654867256635, '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': '5710789', 'n_tokens_mistral': 553, 'n_tokens_neox': 520, 'n_words': 117}