<commit_before>require "spec_helper"
require "service_provider/method_decorators/requires"
require "service_provider/method_decorators/provides"

class SquareService
  extend MethodDecorators

  +Provides.new(:square_service)

  def initialize
  end

  def square(num)
    num * num
  end

  include ServiceProvider
end

class PlusThreeService
  extend MethodDecorators

  +Provides.new(:plus_three_service)

  def initialize
  end

  def plus3(num)
    num + 3
  end

  include ServiceProvider
end

class SuperMathService
  extend MethodDecorators

  +Requires.new(:square_service)
  +Requires.new(:plus_three_service)
  +Provides.new("super_math_service")
  def initialize
  end

  def calculate(num)
    @plus_three_service.plus3 @square_service.square(num)
  end

  include ServiceProvider
end

describe ServiceProvider do
  describe "providing a simople service" do
    it "should work for one client using one service" do
      class SquareSample
        extend MethodDecorators
<commit_msg>Fixing a typo<commit_after>require "spec_helper"
require "service_provider/method_decorators/requires"
require "service_provider/method_decorators/provides"

class SquareService
  extend MethodDecorators

  +Provides.new(:square_service)

  def initialize
  end

  def square(num)
    num * num
  end

  include ServiceProvider
end

class PlusThreeService
  extend MethodDecorators

  +Provides.new(:plus_three_service)

  def initialize
  end

  def plus3(num)
    num + 3
  end

  include ServiceProvider
end

class SuperMathService
  extend MethodDecorators

  +Requires.new(:square_service)
  +Requires.new(:plus_three_service)
  +Provides.new("super_math_service")
  def initialize
  end

  def calculate(num)
    @plus_three_service.plus3 @square_service.square(num)
  end

  include ServiceProvider
end

describe ServiceProvider do
  describe "providing a simple service" do
    it "should work for one client using one service" do
      class SquareSample
        extend MethodDecorators

{'fraction_non_alphanumeric': 0.057200200702458605, 'fraction_numerical': 0.0030105368790767687, 'mean_word_length': 4.345844504021447, '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': '6486024', 'n_tokens_mistral': 622, 'n_tokens_neox': 593, 'n_words': 160}