Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
RSpec Dispatch is a simple gem that replaces your default RSpec Formatter to send results from a test run to a web service of your choice. Useful to track RSpec suite results overtime through a custom web application (or endpoint).
Add this line to your application's Gemfile:
gem 'rspec_dispatch'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rspec_dispatch
To use this custom RSpec Formatter (or any custom formatter), you'll need to set it in your RSpec Config:
RSpec.configure do |config|
config.add_formatter(RspecDispatch::Formatter)
end
A variety of configuration options are available for RSpec Dispatch, some optional.
Setup your RSpec Dispatch block (similar to your RSpec.config block):
RspecDispatch.configure do |config|
...
end
Within this config block, a required parameter is "service_url" which is the endpoint that RSpec Dispatch will POST the suite/test results to.
config.service_url = "http://examplehost.com"
Other parameters include:
"verbose" - true/false (boolean) which allows text to be output within the command line when running your test suite.
"custom_data" - (hash) this allows you to dynamically add any hash values to your results before they are sent to your specific web service. Examples might include the current date, a particular build, the environment or other server details, etc...
A full configuration block could look like:
RspecDispatch.configure do |config|
config.service_url = "http://examplehost.com/results"
config.verbose = false
config.custom_data = {author: "Kevin Wanek", date: Date.now}
end
When the results from your test run are sent to your web service, that endpoint will recieve a body with the following structure:
{
"custom_data"=>{...},
"rspec_data"=>{
"duration"=>0.003571,
"example_count"=>4,
"success_count"=>2,
"failure_count"=>1,
"pending_count"=>1
},
"failures"=>[
{...}
],
"successes"=>[
{...},
],
"pending"=>[
{...}
]
}
The "failures", "successes", and "pending" values will be arrays filled with data about each example that was executed during your test run. Those will be structured as follows:
{
"description"=>"example test description",
"status"=>"failed",
"run_time"=>0.000421,
"file_path"=>"profile_spec.rb",
"line_number"=>"15"
}
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that rspec_dispatch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.