mercredi 8 mars 2017

What is a good way to integrate RSpec with another language such as Python or C#?

I wrote a Ruby Gem and other teams in the business will need to implement the same functionality in Python and C#.

I would like to run the exiting specs against the code in the other languages. Although it sounds like a difficult problem, the functionality of the gem is limited to formatting logs. The specs look like:

specify 'success' do
  expect{ logger.info('title', message) }.to output(expected).to_stdout
end

So, the entire test suite can be reduced to a set of expectations where the input is a string and a hash, and the output is a string.

It seems that there should be a easy to write a connector that would allow RSpec to talk to an instance of the code in another language.

Some possibilities include using HTTP or TCP, but I think that would introduce a significant code and complexity in both the specs and the app.

So, is there an established pattern or tool that will do this?

Aucun commentaire:

Enregistrer un commentaire