Sha256: 4b6bc2ec70eb3a20b877b518cc464ec7a27fc5e81d08b6cb15baf497c37243b8

Contents?: true

Size: 845 Bytes

Versions: 52

Compression:

Stored size: 845 Bytes

Contents

describe :hash_iteration_no_block, :shared => true do
  before(:each) do
    @hsh = new_hash(1 => 2, 3 => 4, 5 => 6)
    @empty = new_hash
  end

  ruby_version_is "" ... "1.8.7" do
    it "raises a LocalJumpError when called on a non-empty hash without a block" do
      lambda { @hsh.send(@method) }.should raise_error(LocalJumpError)
    end

    it "does not raise a LocalJumpError when called on an empty hash without a block" do
      @empty.send(@method).should == @empty
    end
  end

  ruby_version_is "1.8.7" do
    it "returns an Enumerator if called on a non-empty hash without a block" do
      @hsh.send(@method).should be_an_instance_of(enumerator_class)
    end

    it "returns an Enumerator if called on an empty hash without a block" do
      @empty.send(@method).should be_an_instance_of(enumerator_class)
    end
  end
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
rhodes-7.6.0 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-7.5.1 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-7.4.1 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-7.1.17 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-6.2.0 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-6.0.11 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-5.5.18 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-5.5.17 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-5.5.15 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-5.5.0.22 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-5.5.2 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-5.5.0.7 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-5.5.0.3 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-5.5.0 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
tauplatform-1.0.3 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
tauplatform-1.0.2 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
tauplatform-1.0.1 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-3.5.1.12 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-3.3.5 spec/framework_spec/app/spec/core/hash/shared/iteration.rb
rhodes-3.4.2 spec/framework_spec/app/spec/core/hash/shared/iteration.rb