Sha256: 03213af95fb23f4076dde8a09c696ad017066630d0e57bbb0c640ebbd227beff

Contents?: true

Size: 434 Bytes

Versions: 1

Compression:

Stored size: 434 Bytes

Contents

shared_examples_for "all means" do |mean_method|
  it "is nil for an empty array" do
    Mean.send(mean_method, []).should be_nil
  end

  it "is the singleton element of a singleton array" do
    element = 5.5
    Mean.send(mean_method, [element]).should == element
  end

  it "is the common value in an array when all values are equal" do
    element = 5.5
    Mean.send(mean_method, [element, element]).should == element
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
means-1.2.5 spec/support/shared_examples_for_all_means.rb