Vigia
Adaptable API integration test suite that supports API blueprint and RAML files
Install / Use
/learn @nogates/VigiaREADME
Vigia
What is it?
<img src="http://singularities.org/vigia.png" width="96" height="96" class="right" alt="Vigia logo" />Vigia is a gem to perform integration tests on an API server using RSpec and a compatible adapter. The adapter creates the structure of the test (groups and context) and sets up all the variables (See Context variables) used to perform the http request.
These results and expectations objects can be used to run examples that will compare the expected value with the server response value. Vigia allows to use a variety of different ways to execute these comparisons (See Vigia Examples and Custom Shared Examples)
Installation
Include Vigia as gem inside :test group
group :test do
gem 'vigia'
end
Run bundle install
$ bundle install
Now, Vigia can be used inside your application.
Getting started
This example shows an easy way to start a rails server and perform you apibs test.
# Your lib/tasks/vigia.rake
namespace :spec do
desc 'Run Vigia tests'
task :vigia => :environment do
# start rails server by the easiest way
system("bundle exec rails s -e #{ Rails.env } -d")
# give some time to the server
sleep 10
Vigia.configure do |config|
config.source_file = "#{ Rails.root }/apibs/my_api.apib"
config.host = 'http://localhost:3000'
end
Vigia.rspec!
end
end
Adapters
Currently, Vigia supports API Blueprint and RAML definition files. By default, Vigia uses the Blueprint Adapter. To configure Vigia to use the RAML adapter, just pass the adapter class to the config block
Vigia.configure do |config|
config.adapter = Vigia::Adapters::Raml
config.source_file = 'my_api_definition.raml'
# extra config
end
(See Adapters) to see more information about custom adapters.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
License
See LICENSE.
Related Skills
openhue
337.4kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
337.4kElevenLabs text-to-speech with mac-style say UX.
weather
337.4kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.4kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
