Unless the whole garment is in rib, generally the swatch is done with the stitch of the main pattern. Most patterns will tell you this.
If the majority of the object is rib, and it says to gauge in rib, then you need to just lie it flat. It is best to take it off the needles, but if it is a big enough swatch, that isn't necessary.