Skip to content

A wire protocol for RSSpec. This is really an object message passing protocol over HTTP using REST and JSON for parameter encoding. The goal is to maintain a normal workflow of test/fail/code/pass/refactor/pass or Red-Green-Refactor using Cucumber and RSpec and writing the code in your target language.

License

edhowland/spec_wire

Repository files navigation

spec_wire

Note: This project is deprecated. Note: Caution: A dependant gem (rest-client) was found to have a security vulnerablity. The vulnerable versions were yanked from rubygems.org. This gem was also yanked from rubygems.org by myself. (Ed Howland). You can build the gem for yourself from the .gemspec file.

Notes:

  • This Github repository will also be removed by January 1st, 2020.

  • This file should be renamed README.md

  • This Ruby project should be updated to use Bundler and Gemfile.

  • Internally, rest-client should be replaced by json-rpc.

  • json-rpc-client

  • json-rpc - The server for Sinatra and Rack

The above gems implement the version 2.0 JSON RPC protocol.

A wire protocol for RSSpec and Cucumber. This is really an object message passing protocol over HTTP using REST and JSON for parameter encoding. The goal is to maintain a normal workflow of test/fail/code/pass/refactor/pass or Red-Green-Refactor using Cucumber and RSpec but writing the code to make them pass in your target language.

spec_wire can also be used with other frameworks like bacon, Shoulda, RubySpec, minitest and others.

Languages to be supported are PHP and C#. There is currently only a PHP server. Hopefully Python, Perl and C# can be added. The reference server is in Ruby and runs on Sinatra.

Install

sudo gem install spec_wire

Go to your target language folder and run the spec_wire command for your target language: <code>

cd [project root]

spec_wire .

# this will copy a PHP template into the current folder. # take note of the server_url it reports.

Configure spec_wire to point at the correct URL

cd spec/

edit spec_helper.rb

Change: config.server_url to the server url in the spec_wire message. Or use your own.

E.g. ‘localhost/~you/<your folder>/spec/server/server.php’

This will be automatically done in a future version.

Also do this for Cucumber if you want:

cd [project root]/features/support

edit env.rb and make the same change

</code> You might want to bundle the server and deploy it on another host, or even a VM appliance. Just tarball the spec/server folder and untar it in the destination. The server/server.php [or whatever] should be reachable via a browser. Then edit the config.server_url to point to it.

[ if you are running a language with a non-Apache server, like Ruby, you need to start the server: spec/bin/server.start ]

In the spec folder, test out that everything is wired up:

spec initial_spec.rb

This should pass.

Usage

Now get started!

Write your specs:

Write code to make them pass.

Write your cukes.

Write code to make them pass.

Refactor!

Resources

spec_wire on Gemcutter:

soec_wire on Github

spec_wire Google Group

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add specs for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Copyright © 2009, 2010 Ed Howland. See LICENSE for lots of details.

About

A wire protocol for RSSpec. This is really an object message passing protocol over HTTP using REST and JSON for parameter encoding. The goal is to maintain a normal workflow of test/fail/code/pass/refactor/pass or Red-Green-Refactor using Cucumber and RSpec and writing the code in your target language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published