FitNesse in Ruby- Installation

0

FitNesse is a framework for acceptance testing that is needed to test the business logic of an application; it's for documenting the customer requirements of a system and testing them against the implemented code. FitNesse is a wiki-based web server  with which you can easily create and edit pages. It's based on fit,  and it's motto is: Download-and-go.

FitNesse is a lightweight, open-source framework that makes it easy for software teams to:

  • Collaboratively define acceptance tests
  • Run those tests and see the results (see TwoMinuteExample).

But it needs some specific configurations to implement a Ruby file; just try to following steps:

  1. Install Ruby
  2. Install Fitnesse.zip
  3. Install RubyFITas a gem in your Ruby environment. It's a program that is required for each implementation of FIT that couples FitNesse with it.
  4. Set up the environment. Set the COMMAND_PATTERN inside your test case page like so:
  5. !define COMMAND_PATTERN {c:/ruby/bin/ruby -I %p -I c:/ruby/lib/ruby/gems/1.8/gems/fit-1.1/lib c:/ruby/lib/ruby/gems/1.8/gems/fit-1.1/bin/FitServer.rb}
    !path F:/Mytest
    !|Fitnesse1.Division|
    |numerator|denominator| quotient()|
    |2|1|10|
    |60|30|2|

    Note that you have to direct the path to both the FitServer.rb and the lib folder as well.

  6. Set the path of your test file
  7. !path F:/Mytest
    require 'fit/column_fixture'
    module Fitnesse1
      class Division < Fit::ColumnFixture
      attr_accessor :numerator, :denominator
        def quotient()
          @numerator.to_f / @denominator.to_f
        end
      end
    end

    Note that the actual path of the file is: F:\Mytest\Fitnesse1\division.rb

     

     

  8. Now save it and press the test button below the FitNess icon and you'll get the following:


(Success in green and failure in red)

Welcome to the world of FitNesse!

Reference:

http://fitnesse.org/

Post a Comment

eSpace podcast Prodcast

RSS iTunes