Manther/enumb — pull request #2 by lynxbat (2014-01-20 20:32:20+00:00)
Title: Include?, Map, better Each

Enum existence with .include?, .map, better .each and matching rspec test coverage
Existing .each tests pass.

Examples of new features in the following tests:

```ruby
describe '.include?' do

it 'returns true for an Enum that is defined' do
class TestEnumToInclude
extend Enumb
enumerator :Alpha => 1
enumerator :Beta => 2
enumerator :Charlie => 3
enumerator :Echo => 4
end
x = TestEnumToInclude.Beta

class TestEnumTonNotInclude
extend Enumb
enumerator :Alpha => 5
enumerator :Beta => 6
enumerator :Charlie => 7
enumerator :Echo => 8
end
y = TestEnumTonNotInclude.Beta

expect(TestEnumToInclude.include?(x)).to be_true
expect(TestEnumToInclude.include?(y)).to be_false
end

end

describe '.map' do

it 'returns Array of enums' do
class TestEnumToInclude
extend Enumb
enumerator :Alpha => 1
enumerator :Beta => 2
enumerator :Charlie => 3
enumerator :Echo => 4
end
expect(TestEnumToInclude.map).to match_array [TestEnumToInclude.Alpha, TestEnumToInclude.Beta, TestEnumToInclude.Charlie, TestEnumToInclude.Echo]
end

end

describe '.enums' do

it 'returns Array of enums' do
class TestEnumToInclude
extend Enumb
enumerator :Alpha => 1
enumerator :Beta => 2
enumerator :Charlie => 3
enumerator :Echo => 4
end
expect(TestEnumToInclude.map).to match_array [TestEnumToInclude.Alpha, TestEnumToInclude.Beta, TestEnumToInclude.Charlie, TestEnumToInclude.Echo]
end

end
```