<commit_before>require File.dirname(__FILE__) + '/test_helper'

class TestApp < Test::Unit::TestCase
  context "an app" do
    setup { @app = App.new }

    should "have a settable name" do
      assert @app.name
      @app.name = "foobar"
      assert_equal "foobar", @app.name
    end
    
    should "return nil if called without args" do
      assert_equal nil, @app.route
    end

    should "route a single symbol" do
      assert @app.respond_to? :route
      assert @app.route(:posts)
    end

    context "on which route :posts has been called " do
      setup { @app.route :posts }

      should "have routes on itself and its goal" do 
        assert_equal @app.routes, [:posts]
        assert_equal @app.goals[:post].routes, [[:posts]]
        assert_match "route :posts", @app.goaloc_log.first
      end

      should "have a resource tuple" do
        assert_equal @app.goals[:post].resource_tuple, [:posts]
      end
    end

    context "when routing a single symbol" do
      setup { @app.route(:posts)}<commit_msg>added the beginnings of a new test.<commit_after>require File.dirname(__FILE__) + '/test_helper'

class TestApp < Test::Unit::TestCase
  context "an app" do
    setup { @app = App.new }

    should "have a settable name" do
      assert @app.name
      @app.name = "foobar"
      assert_equal "foobar", @app.name
    end
    
    should "return nil if called without args" do
      assert_equal nil, @app.route
    end

    should "route a single symbol" do
      assert @app.respond_to? :route
      assert @app.route(:posts)
    end

    context "on which route :posts has been called " do
      setup { @app.route :posts }

      should "have routes on itself and its goal" do 
        assert_equal @app.routes, [:posts]
        assert_equal @app.goals[:post].routes, [[:posts]]
        assert_match "route :posts", @app.goaloc_log.first
      end

      should "have a resource tuple" do
        assert_equal @app.goals[:post].resource_tuple, [:posts]
      end

      should "have a generate method"
    end

    context "when routing a single symbol" do
      setup { @app.route(:posts)}
{'fraction_non_alphanumeric': 0.10305882352941176, 'fraction_numerical': 0.0, 'mean_word_length': 2.5551839464882944, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1728046', 'n_tokens_mistral': 662, 'n_tokens_neox': 641, 'n_words': 216}