PropSchema v0.2.1 PropSchema.Stream
Reads the prop_schema
information from the provided module. Then it constructs a series of private functions to
include in a test module according to provided field requirements and other considerations declared in the schema.
Link to this section Summary
Functions
Scans the schema and calls generate_incomplete_map/3
for each field as the missing_prop
Creates the quoted fixed_map expression like you would find in the property tests but can be used at your discretion
Creates the quoted fixed_map expression but with the specified missing_prop
excluded
Link to this section Functions
Scans the schema and calls generate_incomplete_map/3
for each field as the missing_prop
Example
defmodule Test do
require PropSchema.Stream
PropSchema.Stream.generate_all_incomplete_maps(PropSchema.ExampleModule, PropSchema.ExampleAdditionalProperties)
def get_ten(excluded), do: incomplete(excluded) |> Enum.take(10)
end
Creates the quoted fixed_map expression like you would find in the property tests but can be used at your discretion.
Example
defmodule Test do
require PropSchema.Stream
PropSchema.Stream.generate_complete_map(PropSchema.ExampleModule, PropSchema.ExampleAdditionalProperties)
def get_ten(), do: complete() |> Enum.take(10)
end
Creates the quoted fixed_map expression but with the specified missing_prop
excluded.
Example
defmodule Test do
require PropSchema.Stream
PropSchema.Stream.generate_incomplete_map(PropSchema.ExampleModule, :test_int, PropSchema.ExampleAdditionalProperties)
def get_ten(excluded), do: incomplete(excluded) |> Enum.take(10)
end