Sha256: fea638267367d34edfb147e729f2a032543d3d1e8ac1ce2ab9ab8d5350c27acf

Contents?: true

Size: 253 Bytes

Versions: 7

Compression:

Stored size: 253 Bytes

Contents

require "rspec"

=begin
example)
[1, 2, 3].should array_instance_of Fixnum
=end

RSpec::Matchers.define :array_instance_of do |element_class|
  match do |array|
    array.class == Array && array.all? {|element| element.class == element_class}
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rubicure-0.0.7 spec/support/array_instance_of.rb
rubicure-0.0.6 spec/support/array_instance_of.rb
rubicure-0.0.5 spec/support/array_instance_of.rb
rubicure-0.0.4 spec/support/array_instance_of.rb
rubicure-0.0.3 spec/support/array_instance_of.rb
rubicure-0.0.2 spec/support/array_instance_of.rb
rubicure-0.0.1 spec/support/array_instance_of.rb