Sha256: 3f5843c3671e72638d79f1d22b41e5a00aee1fd47cd84cb66c00651c32c0b194

Contents?: true

Size: 379 Bytes

Versions: 74

Compression:

Stored size: 379 Bytes

Contents

require 'native'

describe "Native::Object#each" do
  it "enumerates on object properties" do
    Native(`{ a: 2, b: 3 }`).each {|name, value|
      ((name == :a && value == 2) || (name == :b && value == 3)).should be_true
    }
  end

  it "accesses the native when no block is given" do
    Native(`{ a: 2, b: 3, each: function() { return 42; } }`).each.should == 42
  end
end

Version data entries

74 entries across 74 versions & 3 rubygems

Version Path
opal-1.7.4 spec/opal/stdlib/native/each_spec.rb
opal-1.7.3 spec/opal/stdlib/native/each_spec.rb
opal-1.7.2 spec/opal/stdlib/native/each_spec.rb
opal-1.7.1 spec/opal/stdlib/native/each_spec.rb
opal-1.7.0 spec/opal/stdlib/native/each_spec.rb
opal-1.7.0.rc1 spec/opal/stdlib/native/each_spec.rb
opal-1.6.1 spec/opal/stdlib/native/each_spec.rb
opal-1.6.0 spec/opal/stdlib/native/each_spec.rb
opal-1.6.0.rc1 spec/opal/stdlib/native/each_spec.rb
opal-1.6.0.alpha1 spec/opal/stdlib/native/each_spec.rb
opal-1.5.1 spec/opal/stdlib/native/each_spec.rb
opal-1.5.0 spec/opal/stdlib/native/each_spec.rb
opal-1.5.0.rc1 spec/opal/stdlib/native/each_spec.rb
opal-1.4.1 spec/opal/stdlib/native/each_spec.rb
opal-1.4.0 spec/opal/stdlib/native/each_spec.rb
opal-1.4.0.alpha1 spec/opal/stdlib/native/each_spec.rb
opal-1.3.2 spec/opal/stdlib/native/each_spec.rb
opal-1.3.1 spec/opal/stdlib/native/each_spec.rb
opal-1.3.0 spec/opal/stdlib/native/each_spec.rb
opal-1.3.0.rc1 spec/opal/stdlib/native/each_spec.rb