Bill Christian
2011-Dec-14 03:32 UTC
[rspec-users] Advice on using Rspec as a data validation engine
I have a project that collects various application configurations across a couple thousand servers and wants to validate settings are following recommended values. For example, all weblogic servers should have a minimum memory heap size of 512M. Any violators should be reported. Being very impressed with the RSpec DSL, I am using RSpec to validate these data rules. I pre-populate an object with all configurations for a given server and use RSpec expectations to ensure they match the recommended values. My current runner loads each instance and runs RSpec. Of course this is not truly performing unit testing, but it appears to be an easy way to expressively define data rules and run expectations. I''ve gotten it to work. However, this is my first time at instrumenting RSpec outside of rake and creating my own custom formatter. I am curious if I am mangling the use of RSpec and/or complete missing a better way of scripting RSpec to perform data validation rules. I would really appreciate any feedback on how I am using RSpec, or the runner code <https://gist.github.com/1475144> I put together, or suggestions on looking at other projects automating RSpec executions for inspiration. Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20111213/4649826b/attachment-0001.html>
Pat Maddox
2011-Dec-22 19:54 UTC
[rspec-users] Advice on using Rspec as a data validation engine
On Dec 13, 2011, at 9:32 PM, Bill Christian <bill.christian at gmail.com> wrote:> I have a project that collects various application configurations across a couple thousand servers and wants to validate settings are following recommended values. For example, all weblogic servers should have a minimum memory heap size of 512M. Any violators should be reported. > > Being very impressed with the RSpec DSL, I am using RSpec to validate these data rules. I pre-populate an object with all configurations for a given server and use RSpec expectations to ensure they match the recommended values. My current runner loads each instance and runs RSpec. > > Of course this is not truly performing unit testing, but it appears to be an easy way to expressively define data rules and run expectations. I''ve gotten it to work. However, this is my first time at instrumenting RSpec outside of rake and creating my own custom formatter. I am curious if I am mangling the use of RSpec and/or complete missing a better way of scripting RSpec to perform data validation rules. > > I would really appreciate any feedback on how I am using RSpec, or the runner code I put together, or suggestions on looking at other projects automating RSpec executions for inspiration. > > Thanks in advance. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-usersI can''t comment on the specifics of your configuration but I think this is a fine use of RSpec. I love using RSpec for stuff like this. Unit tests aren''t the only things in the world that need automated checks :) Pat -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20111222/5c38b3dc/attachment.html>
Bill Christian
2012-Feb-22 20:28 UTC
[rspec-users] Advice on using Rspec as a data validation engine
I have a working prototype. However, I am having trouble instrumenting the automation. Are there existing examples or libraries that execute tests outside of a console? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120222/f981fd50/attachment.html>