<commit_before>require 'test_helper'

module Lina
  class SchemaControllerTest < ActionController::TestCase
    test "schema api" do
      skip "next"
    end

    test "Lina::ApiSpecError" do
      a = -> {
        class WrongAPiSpecController < Lina::ApplicationController
          define_action :index, { params: 'spec erorr' } do
          end
        end
      }

      assert_raise(Lina::ApiSpecError, &a)
    end

  end
end<commit_msg>add api params&return schema test<commit_after>require 'test_helper'

module Lina
  class SchemaControllerTest < ActionController::TestCase
    test "schema api" do
      skip "next"
    end

    test "Lina::ApiSpecError" do
      a = -> {
        class WrongAPiSpecController < Lina::ApplicationController
          define_action :index, { params: 'spec erorr' } do
          end
        end
      }

      assert_raise(Lina::ApiSpecError, &a)
    end

    test "Lina::ApiSpecParamsError" do
      a = -> {
        class WrongAPiSpecController < Lina::ApplicationController
          define_action :index, {
            name: 'index',
            params: { type: 'object1' },
            return: {}
          } do
          end
        end
      }

      assert_raise(Lina::ApiSpecParamsError, &a)
    end

    test "Lina::ApiSpecReturnError" do
      a = -> {
        class WrongAPiSpecController < Lina::ApplicationController
          define_action :index, {
            name: 'index',
            params: {},
            return: { type: 'object1' }
          } do
          end
        end
      }

      assert_raise(Lina::ApiSpecReturnError, &a)
    end
  end
end
{'fraction_non_alphanumeric': 0.09113453192808431, 'fraction_numerical': 0.0012399256044637321, 'mean_word_length': 1.988888888888889, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '6712400', 'n_tokens_mistral': 478, 'n_tokens_neox': 464, 'n_words': 113}