diff options
| author | mokha <mokha@cisco.com> | 2019-02-23 09:21:34 -0700 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2019-02-23 09:21:34 -0700 |
| commit | 7eb9bc3b13811e8a05dfc82d25fd23fabc15916b (patch) | |
| tree | 86ba4226e38475e2530ab0cbf53011a1dfef74dc | |
| parent | 311579373b120860ed005b1384584371966d8992 (diff) | |
camelize the default descriptionv0.3.2
| -rw-r--r-- | CHANGELOG.md | 9 | ||||
| -rw-r--r-- | lib/scim/kit/v2/attribute_type.rb | 2 | ||||
| -rw-r--r-- | lib/scim/kit/version.rb | 2 | ||||
| -rw-r--r-- | spec/scim/kit/v2/attribute_type_spec.rb | 7 |
4 files changed, 16 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 5868cf7..bb58abf 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/lib/scim/kit/v2/attribute_type.rb b/lib/scim/kit/v2/attribute_type.rb index c24a446..0743372 100644 --- a/lib/scim/kit/v2/attribute_type.rb +++ b/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 diff --git a/lib/scim/kit/version.rb b/lib/scim/kit/version.rb index 3e05f49..24a707d 100644 --- a/lib/scim/kit/version.rb +++ b/lib/scim/kit/version.rb @@ -2,6 +2,6 @@ module Scim module Kit - VERSION = '0.3.1' + VERSION = '0.3.2' end end diff --git a/spec/scim/kit/v2/attribute_type_spec.rb b/spec/scim/kit/v2/attribute_type_spec.rb index 1dd38a6..3adae0c 100644 --- a/spec/scim/kit/v2/attribute_type_spec.rb +++ b/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') } |
