Commit 7eb9bc3
Changed files (4)
lib/scim/kit/v2/attribute_type.rb
@@ -14,7 +14,7 @@ module Scim
def initialize(name:, type: :string)
@name = name.to_s.underscore
@type = DATATYPES[type.to_sym] ? type.to_sym : (raise TYPE_ERROR)
- @description = name
+ @description = name.to_s.camelize(:lower)
@multi_valued = false
@required = false
@case_exact = false
lib/scim/kit/version.rb
@@ -2,6 +2,6 @@
module Scim
module Kit
- VERSION = '0.3.1'
+ VERSION = '0.3.2'
end
end
spec/scim/kit/v2/attribute_type_spec.rb
@@ -14,6 +14,13 @@ RSpec.describe Scim::Kit::V2::AttributeType do
specify { expect { described_class.new(name: 'photo', type: :binary) }.not_to raise_error }
specify { expect { described_class.new(name: 'invalid', type: :invalid) }.to raise_error(ArgumentError) }
+ describe 'with a symbolic name' do
+ subject { described_class.new(name: :display_name) }
+
+ specify { expect(subject.to_h[:name]).to eql('displayName') }
+ specify { expect(subject.to_h[:description]).to eql('displayName') }
+ end
+
describe 'String Attribute' do
describe 'defaults' do
subject { described_class.new(name: 'displayName') }
CHANGELOG.md
@@ -1,4 +1,4 @@
-Version 0.3.1
+Version 0.3.2
# Changelog
All notable changes to this project will be documented in this file.
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- NA
+## [0.3.2] - 2019-02-23
+### Changed
+- camelize the default description of attribute names.
+
## [0.3.1] - 2019-02-23
### Changed
- fix bug in `Scim::Kit::V2.configure`
@@ -31,7 +35,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- \_assign does not coerce values by default.
- errors are merged together instead of overwritten during attribute validation.
-[Unreleased]: https://github.com/mokhan/scim-kit/compare/v0.3.1...HEAD
+[Unreleased]: https://github.com/mokhan/scim-kit/compare/v0.3.2...HEAD
+[0.3.2]: https://github.com/mokhan/scim-kit/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/mokhan/scim-kit/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/mokhan/scim-kit/compare/v0.2.16...v0.3.0
[0.2.16]: https://github.com/mokhan/scim-kit/compare/v0.2.15...v0.2.16