Runtime assertions for Ruby literal.fun
ruby
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

Simplify Rubocop configuration

We can delegate everything to goodcop here now.

+15 -43
-27
.rubocop.yml
··· 3 3 4 4 AllCops: 5 5 TargetRubyVersion: 3.1 6 - 7 - Naming/MethodName: 8 - Enabled: false 9 - 10 - Style/MixinUsage: 11 - Enabled: false 12 - 13 - Style/MultilineBlockChain: 14 - Enabled: false 15 - 16 - Lint/Void: 17 - Enabled: false 18 - 19 - Style/MissingRespondToMissing: 20 - Enabled: false 21 - 22 - Style/ColonMethodCall: 23 - Enabled: false 24 - 25 - Style/NilComparison: 26 - Enabled: false 27 - 28 - Style/YodaCondition: 29 - Enabled: false 30 - 31 - Layout/IndentationWidth: 32 - Enabled: false
+2 -2
lib/literal/properties.rb
··· 30 30 end 31 31 32 32 unless Literal::Property::VISIBILITY_OPTIONS.include?(predicate) 33 - raise Literal::ArgumentError.new("The predicate must be one of #{Literal::Property::VISIBILITY_OPTIONS.map(&:inspect).join(', ')}.") 33 + raise Literal::ArgumentError.new("The predicate must be one of #{Literal::Property::VISIBILITY_OPTIONS.map(&:inspect).join(', ')}.") 34 34 end 35 35 36 36 if reader && :class == name ··· 90 90 end 91 91 92 92 def to_h 93 - {} 93 + {} 94 94 end 95 95 96 96 set_temporary_name "Literal::Properties(Extension)" if respond_to?(:set_temporary_name)
+8 -8
test/array.test.rb
··· 389 389 end 390 390 391 391 test "#each_index iterates through the indexes" do 392 - array = Literal::Array(Integer).new(1, 2, 3) 393 - indexes = [] 392 + array = Literal::Array(Integer).new(1, 2, 3) 393 + indexes = [] 394 394 395 - array.each_index { |i| indexes << i } 395 + array.each_index { |i| indexes << i } 396 396 397 - assert_equal indexes, [0, 1, 2] 397 + assert_equal indexes, [0, 1, 2] 398 398 end 399 399 400 400 test "#insert inserts single element at index offset" do ··· 770 770 end 771 771 772 772 test "#take_while takes elements where the block returns true" do 773 - array = Literal::Array(Integer).new(1, 2, 3, 4, 5) 773 + array = Literal::Array(Integer).new(1, 2, 3, 4, 5) 774 774 775 - return_value = array.take_while { |i| i < 3 } 775 + return_value = array.take_while { |i| i < 3 } 776 776 777 - refute_same return_value, array 778 - assert_equal return_value, Literal::Array(Integer).new(1, 2) 777 + refute_same return_value, array 778 + assert_equal return_value, Literal::Array(Integer).new(1, 2) 779 779 end 780 780 781 781 test "#shuffle returns a new shuffled array" do
+5 -6
test/rails.test.rb
··· 1 1 # frozen_string_literal: true 2 2 3 3 test "ActiveRecord::Relation with non-ActiveRecord::Base child" do 4 - assert_raises(Literal::TypeError) do 5 - Class.new do 6 - extend Literal::Properties 7 - 8 - prop :example, ActiveRecord::Relation(String) 9 - end 4 + assert_raises(Literal::TypeError) do 5 + Class.new do 6 + extend Literal::Properties 7 + prop :example, ActiveRecord::Relation(String) 10 8 end 9 + end 11 10 end