title: Expect all array elements to be of the same class
body: <p>I want to check that an array contains only objects of a specific class, let's say <code>Float</code>.</p>
  
  <p>A working example at the moment:</p>
  
  <pre><code>it "tests array_to_test class of elements" do
    expect(array_to_test.count).to eq(2)
    expect(array_to_test[0]).to be_a(Float)
    expect(array_to_test[1]).to be_a(Float)
  end
  </code></pre>
  
  <p>Is there a way to validate if the <code>array_to_test</code> contains only <code>Float</code> instances?</p>
  
  <p>Sample non-working pseudocode:</p>
  
  <pre><code>it "tests array_to_test class of elements" do
    expect(array_to_test).to be_a(Array[Float])
  end
  </code></pre>
  
  <p>Do not consider Ruby and Rspec version as a restriction.</p>