<commit_before>require 'teststrap'

context "Using denies" do

  context "with a test that should pass" do
    setup do
      Riot::Context.new("<NAME>") do
        denies("with false") { false }
      end.run(MockReporter.new)
    end

    asserts("passes, failures, errors") do
      [topic.passes, topic.failures, topic.errors]
    end.equals([1,0,0])
  end

  context "with a test that should fail" do
    setup do
      Riot::Context.new("<NAME>") do
        denies("with true") { true }
      end.run(MockReporter.new)
    end

    asserts("passes, failures, errors") do
      [topic.passes, topic.failures, topic.errors]
    end.equals([0,1,0])
  end

  context "with a test that should error" do
    setup do
      Riot::Context.new("<NAME>") do
        denies("ooooops") { raise Exception }
      end.run(MockReporter.new)
    end

    asserts("passes, failures, errors") do
      [topic.passes, topic.failures, topic.errors]
    end.equals([0,0,1])
  end

end # Calling context with deny<commit_msg>Refactored denies testing<commit_after>require 'teststrap'

context "Using denies" do

  asserts("result when returning false from the assertion block") do
    report = Riot::Context.new("<NAME>") do
      denies("with false") { false }
    end.run(MockReporter.new)
    [report.passes, report.failures, report.errors]
  end.equals([1,0,0])

  asserts("result when returning true from the assertion block") do
    report = Riot::Context.new("<NAME>") do
      denies("with true") { true }
    end.run(MockReporter.new)
    [report.passes, report.failures, report.errors]
  end.equals([0,1,0])

  asserts("result when assertion block has an exception") do
    report = Riot::Context.new("<NAME>") do
      denies("ooooops") { raise Exception }
    end.run(MockReporter.new)
    [report.passes, report.failures, report.errors]
  end.equals([0,0,1])

end # Using denies
{'fraction_non_alphanumeric': 0.13493333333333332, 'fraction_numerical': 0.0096, 'mean_word_length': 3.3225806451612905, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3805918', 'n_tokens_mistral': 619, 'n_tokens_neox': 608, 'n_words': 158}