spec/unit/modules/enum_spec.rb in ably-0.7.0 vs spec/unit/modules/enum_spec.rb in ably-0.7.1
- old
+ new
@@ -128,9 +128,19 @@
end
it 'behaves like Enumerable' do
expect(subject.map(&:to_sym)).to eql([:value_zero, :value_1, :value_snake_case_2, :sentence_case])
end
+
+ context '#each' do
+ it 'returns an enumerator' do
+ expect(subject.each).to be_a(Enumerator)
+ end
+
+ it 'yields each channel' do
+ expect(subject.each.map(&:to_sym)).to eql([:value_zero, :value_1, :value_snake_case_2, :sentence_case])
+ end
+ end
end
context 'defined Enum from Hash class' do
class ExampleClassWithEnumFromHash
extend Ably::Modules::Enum