Runtime assertions for Ruby literal.fun
ruby
5
fork

Configure Feed

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

Lint

+3 -4
+1 -1
lib/literal/property.rb
··· 51 51 end 52 52 53 53 def default? 54 - return true if splat? || double_splat? 54 + return true if splat? || double_splat? 55 55 nil != @default 56 56 end 57 57
+2 -2
test/properties.test.rb
··· 46 46 refute_raises { example.new } 47 47 refute_raises { example.new("Hello") } 48 48 refute_raises { example.new("Hello", "World") } 49 - refute example.literal_properties[:example].required? { "Expected example to not be required" } 49 + refute example.literal_properties[:example].required? { "Expected example to not be required" } 50 50 end 51 51 52 52 test "keyword splats are optional" do ··· 57 57 refute_raises { example.new } 58 58 refute_raises { example.new(example: "Hello") } 59 59 refute_raises { example.new(example: "Hello", world: "World") } 60 - refute example.literal_properties[:example].required? { "Expected example to not be required" } 60 + refute example.literal_properties[:example].required? { "Expected example to not be required" } 61 61 end 62 62 63 63 test "block params are required by default" do
-1
test/properties/introspection.test.rb
··· 55 55 56 56 test "required_properties returns all required properties" do 57 57 props = BasicIntrospection.required_properties 58 - puts props.inspect 59 58 assert_equal props.map(&:name), [:id, :name, :age] 60 59 assert props.all?(&:required?) 61 60 end