File tree Expand file tree Collapse file tree 8 files changed +75
-6
lines changed
spec/faithteams/api/v2/entity Expand file tree Collapse file tree 8 files changed +75
-6
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ Layout/EmptyLinesAroundModuleBody:
6565# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
6666Style/HashSyntax :
6767 Enabled : true
68+ EnforcedStyle : ruby19
69+ EnforcedShorthandSyntax : never # Ruby 3.1 allows omission of value name, but we want to support prior Ruby versions
6870
6971Layout/FirstArgumentIndentation :
7072 Enabled : true
Original file line number Diff line number Diff line change 1- ruby 3.0.6
1+ ruby 3.3.5
2+
Original file line number Diff line number Diff line change @@ -7,6 +7,27 @@ All notable changes to this project will be documented in this file.
77The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) ,
88and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
99
10+ ## [ Unreleased]
11+
12+ ### Added
13+
14+ 1 . Adds ` Entity::Fund ` ` active? ` and ` default? ` interrogatives
15+
16+ ## [ 4.0.1] - 2024-09-13
17+
18+ This version adds support for Ruby 3.3.5. No real changes were required. We just needed to add some gems to the gemspec
19+ to silence deprecation warnings.
20+
21+ ### Added
22+
23+ 1 . Add dependencies which will be removed from a future version of Ruby. (IN-2512)
24+
25+ ## [ 4.0.0] - 2024-09-11
26+
27+ ### Changed
28+
29+ 1 . Update ActiveSupport Version to support Rails 7. (IN-2109)
30+
1031## [ 3.0.1] - 2024-09-09
1132
1233### Changed
Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- faithteams-api (3.0 .1 )
5- activesupport (>= 6.1.7 )
4+ faithteams-api (4.1 .1 )
5+ activesupport (>= 7.0.8 , <= 7.1.5.1 )
66 http (~> 5.1 )
7+ logger (~> 1.6.1 )
8+ ostruct (~> 0.6.0 )
79 rexml (~> 3.3.6 )
810
911GEM
8789 notiffany (0.1.3 )
8890 nenv (~> 0.1 )
8991 shellany (~> 0.0 )
92+ ostruct (0.6.1 )
9093 parallel (1.26.3 )
9194 parser (3.3.6.0 )
9295 ast (~> 2.4.1 )
136139 rubocop-rspec (1.42.0 )
137140 rubocop (>= 0.87.0 )
138141 ruby-progressbar (1.13.0 )
139- securerandom (0.3.2 )
142+ securerandom (0.4.1 )
140143 shellany (0.0.1 )
141144 simplecov (0.22.0 )
142145 docile (~> 1.1 )
Original file line number Diff line number Diff line change @@ -32,8 +32,10 @@ Gem::Specification.new do |spec|
3232 spec . executables = spec . files . grep ( %r{^exe/} ) { |f | File . basename ( f ) }
3333 spec . require_paths = [ "lib" ]
3434
35- spec . add_dependency "activesupport" , ">= 6.1.7 "
35+ spec . add_dependency "activesupport" , ">= 7.0.8" , "<= 7.1.5.1 "
3636 spec . add_dependency "http" , "~> 5.1"
37+ spec . add_dependency "logger" , "~> 1.6.1"
38+ spec . add_dependency "ostruct" , "~> 0.6.0"
3739 spec . add_dependency "rexml" , "~> 3.3.6" # only needs to be specified to address security warning
3840
3941 spec . add_development_dependency "byebug" , "~> 11.1"
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ def default
1111 read_attribute ( :isDefault ) . presence
1212 end
1313
14+ # @return [Boolean]
15+ def default?
16+ default == "Y"
17+ end
18+
1419 # @return [String, nil]
1520 def description
1621 read_attribute ( :description ) . presence
@@ -41,6 +46,11 @@ def status
4146 read_attribute ( :status ) . presence
4247 end
4348
49+ # @return [Boolean]
50+ def active?
51+ status == "A"
52+ end
53+
4454 # @return [String, nil] "T" for true?, "Y" for yes?
4555 def tax_deductible
4656 read_attribute ( :taxDeductible ) . presence
Original file line number Diff line number Diff line change 22
33module FaithTeams
44 # Current version number.
5- VERSION = "3.0 .1"
5+ VERSION = "4.1 .1"
66end
Original file line number Diff line number Diff line change 2222 end
2323 end
2424
25+ describe "#default?" do
26+ context "when default is 'Y'" do
27+ it "returns true" do
28+ fund = described_class . new ( attributes : { "isDefault" => "Y" } )
29+ expect ( fund ) . to be_default
30+ end
31+ end
32+
33+ context "when default isn't 'Y'" do
34+ it "returns false" do
35+ expect ( fund ) . not_to be_default
36+ end
37+ end
38+ end
39+
2540 describe "description" do
2641 it "is a String" do
2742 expect ( fund . description ) . to be_instance_of ( String )
6479 end
6580 end
6681
82+ describe "#active?" do
83+ context "when status is 'A'" do
84+ it "returns true" do
85+ expect ( fund ) . to be_active
86+ end
87+ end
88+
89+ context "when status isn't 'A'" do
90+ it "returns false" do
91+ fund = described_class . new ( attributes : { "status" => "I" } )
92+ expect ( fund ) . not_to be_active
93+ end
94+ end
95+ end
96+
6797 describe "tax_deductible" do
6898 it "is a String" do
6999 expect ( fund . tax_deductible ) . to be_instance_of ( String )
You can’t perform that action at this time.
0 commit comments