Search >>

RSS   COM     HOME


I have not been able to find a port of FitLibrary for RubyFit. I especially miss the functionality of DoFixture where you can, amongst other things, write fixture tables that contain rows like this

user Alice logs on to server AliceServer

which I find really easy to read.

DoFixture interpret the first and every second cell after that as a name of a method to call and the rest of the cells are interpreted as arguments to that method. So the table row above would be translated into a call to the method similar to

public bool userLogsOnToServer(String user, String Server) {...}

where “Alice” would be passed as the first parameter and “AliceServer” would be passed as the second parameter.

While waiting for this to hit Ruby (if it already has, please let me know), I wrote GoFixture, which looks kind of like an ActionFixture that can call methods DoFixture style.

A table like this

MyGoFixture
user Alice logs on to server AliceServer

can be backed up by the following class


require 'go_fixture'

class MyGoFixture < GoFixture
  def user_logs_on_to_server(user, server)
    ...
  end
end

It seems to work with RubyFit 1.1. If you want to run its unit tests you need FlexMock 0.3.2

You can download GoFixture here.






  One Response to “GoFixture – Waiting for FitLibrary for Ruby”



  1. FitLibrary has not yet been ported to Ruby. I personally started to port some “marginal” fixtures, namely SpecifyFixture, because I needed some of the tests to check features in RubyFIT 1.1. At the moment, at least one other person is known to be unofficially working on FitLibrary. I’ll probably check with him about the status of the port, then perhaps keep implementing myself.

>  Leave a Reply