Sha256: acea52321fd8ddb9a3cc9b256c8d7e1a3cc4287ee17b10c53586b3879fb87195

Contents?: true

Size: 534 Bytes

Versions: 198

Compression:

Stored size: 534 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/patches/enumerator/current'

RSpec.describe ::Enumerator do
  let(:list) { %w[a b] }
  let(:instance) { list.each }

  it { expect(instance).to be_a(described_class) }
  it { expect(instance.current).to eq('a') }

  context 'with first next' do
    before { instance.next }

    it { expect(instance.current).to eq('b') }
  end

  context 'with last next' do
    before do
      instance.next
      instance.next
    end

    it { expect(instance.current).to eq(nil) }
  end
end

Version data entries

198 entries across 198 versions & 3 rubygems

Version Path
eac_tools-0.55.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.55.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.54.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.53.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.52.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.51.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.50.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.49.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.48.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.48.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.47.2 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.47.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.47.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.46.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.45.2 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.45.1 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.45.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.44.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.43.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb
eac_tools-0.42.0 sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/enumerator/current_spec.rb