<commit_before>require 'test_helper'

module ActiveModel
  class Serializer
    class AttributesTest < Minitest::Test
      def setup
        @profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1', nothing: nil })
        @profile_serializer = ProfileSerializer.new(@profile)
      end

      def test_attributes_definition
        assert_equal([:name, :description, :nothing],
                     @profile_serializer.class._attributes)
      end

      def test_attributes_with_fields_option
        assert_equal({name: 'Name 1'},
                     @profile_serializer.attributes(fields: [:name]))
      end

      def test_required_fields
        assert_equal({name: 'Name 1', description: 'Description 1'},
                     @profile_serializer.attributes(fields: [:name, :description], required_fields: [:name]))

      end

      def test_include_nil
        assert_equal({name: 'Name 1', description: 'Description 1', nothing: nil},
                     @profile_serializer.attributes(include_nil: true))

      end
    end
  end
end<commit_msg>Add test which passes false explicitly<commit_after>require 'test_helper'

module ActiveModel
  class Serializer
    class AttributesTest < Minitest::Test
      def setup
        @profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1', nothing: nil })
        @profile_serializer = ProfileSerializer.new(@profile)
      end

      def test_attributes_definition
        assert_equal([:name, :description, :nothing],
                     @profile_serializer.class._attributes)
      end

      def test_attributes_with_fields_option
        assert_equal({name: 'Name 1'},
                     @profile_serializer.attributes(fields: [:name]))
      end

      def test_required_fields
        assert_equal({name: 'Name 1', description: 'Description 1'},
                     @profile_serializer.attributes(fields: [:name, :description], required_fields: [:name]))

      end
      
      def test_include_nil_false
        assert_equal({name: 'Name 1', description: 'Description 1'},
                     @profile_serializer.attributes(include_nil: false))

      end

      def test_include_nil_true
        assert_equal({name: '<NAME>', description: 'Description 1', nothing: nil},
                     @profile_serializer.attributes(include_nil: true))

      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09805544062887878, 'fraction_numerical': 0.00703351261894911, 'mean_word_length': 2.708588957055215, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, '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': '6797536', 'n_tokens_mistral': 665, 'n_tokens_neox': 622, 'n_words': 158}