Pairwise

Ruby based tool for selecting a smaller number of test input combinations (using pairwise generation) rather than exhaustively testing all possible permutations.


Project maintained by aliking Hosted on GitHub Pages — Theme by mattgraham

Pairwise

Installing

gem install pairwise

Using Pairwise with Rspec

describe "something" do
  Pairwise.combinations([1,2], [1,2], [2,3]).each do |(event_id, new_event_id, media_id)|
    it "should do something with these input values" do
      ...
    end
  end
end

Using Pairwise with Cucumber

Create a yaml file with your input combinations:

event with image: [Football, Basketball, Soccer]
event without image: [Football, Basketball, Soccer]
media: [Image, Video, Music]

Run pairwise specifying the yaml file

$ pairwise inputs.yml

This will output a table ready to be used in your Cucumber features.

| media | event without image | event with image |
| Image | Football            | Football         |
| Image | Basketball          | Basketball       |
| Image | Soccer              | Soccer           |
| Video | Football            | Soccer           |
| Video | Basketball          | Football         |
| Video | Soccer              | Basketball       |
| Music | Football            | Basketball       |
| Music | Basketball          | Soccer           |
| Music | Soccer              | Football         |

Author

@josephwilk