<commit_before># vim: ft=elixir sw=2 ts=2
#
defmodule ConcreteTest do
  use ExUnit.Case
  import Should

  should "update count" do
    rented_video = VideoStore.renting(video)
    assert rented_video.times_rented == 1
  end

  def video, do: %Video{title: "XMen"}

end
<commit_msg>+ tests for VideoStore state machine<commit_after># vim: ft=elixir sw=2 ts=2
#
defmodule ConcreteTest do
  use ExUnit.Case
  import Should

  should "update count" do
    rented_video = VideoStore.renting(video)
    assert rented_video.times_rented == 1
  end

  should "rent video" do
    rented_video = VideoStore.Concrete.rent video
    assert :rented == rented_video.state
    assert 1 == rented_video.times_rented
  end

  should "handle multiple transitions" do
    import VideoStore.Concrete
    vid = video |> rent |> return |> rent |> return |> rent
    assert :rented == vid.state
    assert 5 == Enum.count vid.log
    assert 3 == vid.times_rented
  end

  def video, do: %Video{title: "XMen"}

end

{'fraction_non_alphanumeric': 0.09274193548387097, 'fraction_numerical': 0.009072580645161291, 'mean_word_length': 3.555045871559633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '525805', 'n_tokens_mistral': 349, 'n_tokens_neox': 333, 'n_words': 100}