Here I'm maintaining some materials related to my talk given at BGOUG Fall conference on 20 Nov 2015: Oracle PL/SQL Unit testing with ruby-plsql-spec
It's about unit testing and TDD using Ruby, RSpec, ruby-plsql and ruby-plsql-spec
[Oracle PL-SQL unit testing with ruby-plsql-spec.pptx](Oracle PL-SQL unit testing with ruby-plsql-spec.pptx)
To run it:
-
Install Ruby
-
Setup your test schema: you may use
setup_test_user.sql
for the purpose -
Copy
spec/database.yml.sample
tospec/database.yml
. Modify accordingly -
From the project directory run
bundle install rake
-
To trigger the build & tests when files are changed (monitored paths are configured in Guardfile - you can run
guard
A pom.xml example is provided for running the project using Maven and JRuby (how to setup Maven may be found elsewhere).
- You need to register for the Oracle Maven Repository - in order to resolve Oracle JDBC driver dependencies.
- In spec/database.yml you should prefix database name with slash (/) in case you're using connection by host:pord/service-name (instead of host:pord:SID)
- From the project directory run
mvn verify
- Gemfile - dependencies
- Rakefile - Rake build file. Has tasks for source deployment and running tests
- deploy.list - list of database objects to be deployed.
- src - database source files are under src
- setup.rb - simple utility used by Rakefile to deploy deploy.list
- Guardfile - Guard configuration file for triggering the build whenever files are saved
- spec/database.yml - specify database connection details here