<commit_before>require 'spec_helper'

class SimpleBddExample
  include SimpleBdd
end

describe SimpleBddExample do
  let(:subject) { SimpleBddExample.new }

  let(:reporter) do
    double(:reporter, notify: nil)
  end

  before(:each) do
    RSpec.configuration.stub(:reporter).and_return(reporter)
  end
  after(:each) do
    RSpec.configuration.unstub(:reporter)
  end

  describe "#given, #when, #then, #and, #also, #but" do
    ["given", "when", "then", "and", "Given", "When", "Then", "And", "Also", "also", "But", "but"].each do |method|
      it "calls the method after translating the string" do
        expect(subject).to receive(:something)
        subject.send(method, "something")
      end

      it "sends the appropriate start_step notification" do
        allow(subject).to receive(:something)

        expect(reporter).to receive(:notify) do |type, notification|<commit_msg>Fix spec wording<commit_after>require 'spec_helper'

class SimpleBddExample
  include SimpleBdd
end

describe SimpleBddExample do
  let(:subject) { SimpleBddExample.new }

  let(:reporter) do
    double(:reporter, notify: nil)
  end

  before(:each) do
    RSpec.configuration.stub(:reporter).and_return(reporter)
  end
  after(:each) do
    RSpec.configuration.unstub(:reporter)
  end

  describe "#given, #when, #then, #and, #also, #but" do
    ["given", "when", "then", "and", "Given", "When", "Then", "And", "Also", "also", "But", "but"].each do |method|
      it "calls the method after translating the string" do
        expect(subject).to receive(:something)
        subject.send(method, "something")
      end

      it "sends the appropriate before_step notification" do
        allow(subject).to receive(:something)

        expect(reporter).to receive(:notify) do |type, notification|
{'fraction_non_alphanumeric': 0.1366181410974244, 'fraction_numerical': 0.0, 'mean_word_length': 3.9501385041551247, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3590586', 'n_tokens_mistral': 568, 'n_tokens_neox': 549, 'n_words': 153}