README.md in raap-0.6.0 vs README.md in raap-0.8.0

- old
+ new

@@ -1,8 +1,8 @@ # RaaP -<img src="https://raw.githubusercontent.com/ksss/raap/main/public/jacket.webp" width=400/> +<img src="https://raw.githubusercontent.com/ksss/raap/main/public/jacket.webp" width=500/> ## RBS as a Property RaaP is a property based testing tool. @@ -12,10 +12,14 @@ The return value of the method is checked to see if it matches the type, if not, the test fails. If you write an RBS, it becomes a test case. +## Example + +<img src="https://raw.githubusercontent.com/ksss/raap/main/public/example.webp" width=700/> + ## Concept If you has next signature. ```rbs @@ -51,10 +55,14 @@ Then, you can start loop again. Finally, you get the perfect RBS! +## Slide + +https://speakerdeck.com/ksss/raap + ## Installation Install the gem and add to the application's Gemfile by executing: $ bundle add raap --require false @@ -86,10 +94,24 @@ - error: Information on status of inability to continue execution. - warn: Information on partial corrections required. - info: A somewhat visualized representation of the execution state. - debug: All information including stack traces. +## Coverage + +RaaP randomly selects a type and generates a value for optional and union types. + +By default, displays the coverage of the type that actually produced the value. + +The coverage display can help you determine if a correction is needed. + +### Meaning of colored types + +- 🔴 Red: A type that has never been used to generate or validate a value. +- 🟡 Yellow: It is systematically difficult to determine if the type was used or not. (FIXME) +- 🟢 Green: The type used to generate and validate the value. + ## Size Random values are determined based on size. For example, an Integer with size zero is `0` and an Array is `[]`. @@ -147,9 +169,45 @@ ### `--allow-private` By default, raap only validates public methods. However, by setting this option, it is possible to intentionally validate private methods in the RBS. + +### `--preload path` + +Simply call `Kernel.load`. +However, this simplifies the preliminary preparation. + +#### Preload examples + +1) Check signature of aws-sdk-s3 + +```rb +$ cat preload.rb +require 'aws-sdk-s3' + +# Register initialize of `Aws::S3::Client` class. +RaaP::Type.register("Aws::S3::Client") do + [:call, Aws::S3::Client, :new, [], { stub_responses: true }, nil] +end + +$ raap --preload ./preload.rb 'Aws::S3::Client#get_object' +``` + +2) Output ruby coverage by simplecov + +```rb +$ cat preload.rb +require 'simplecov' + +SimpleCov.command_name 'raap' +SimpleCov.start do + enable_coverage :branch + add_filter "/test/" +end + +$ bundle exec raap --preload ./preload.rb -r my_class 'MyClass' +``` ## First support is CLI In RaaP, usage through the CLI is the primary support focus, and efforts are made to maintain compatibility. The use of the library's code (such as `RaaP::Type`) does not guarantee compatibility.