From faa3374eaa19a056bd7cceafb55eebd9f0b07471 Mon Sep 17 00:00:00 2001 From: Tom Bromehead Date: Wed, 28 Jul 2021 13:33:40 +0200 Subject: [PATCH 1/2] Memoization prevents @market_cap from being updated --- .../solutions/public_company_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11-matchers-included-in-rspec-expectations/solutions/public_company_spec.rb b/11-matchers-included-in-rspec-expectations/solutions/public_company_spec.rb index 15ae6c2..b2b7f3b 100644 --- a/11-matchers-included-in-rspec-expectations/solutions/public_company_spec.rb +++ b/11-matchers-included-in-rspec-expectations/solutions/public_company_spec.rb @@ -4,7 +4,7 @@ def got_better_than_expected_revenues end def market_cap - @market_cap ||= value_per_share * share_count + @market_cap = value_per_share * share_count end end From d709bd826801e8d0b9dc8cf22dae57d8e88ff1f5 Mon Sep 17 00:00:00 2001 From: Tom Bromehead Date: Wed, 28 Jul 2021 13:34:15 +0200 Subject: [PATCH 2/2] Use squiggly heredoc to remove leading whitespace --- .../solutions/tokenizer_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11-matchers-included-in-rspec-expectations/solutions/tokenizer_spec.rb b/11-matchers-included-in-rspec-expectations/solutions/tokenizer_spec.rb index b253e02..5b9c04f 100644 --- a/11-matchers-included-in-rspec-expectations/solutions/tokenizer_spec.rb +++ b/11-matchers-included-in-rspec-expectations/solutions/tokenizer_spec.rb @@ -6,7 +6,7 @@ def self.tokenize(string) RSpec.describe Tokenizer do let(:text) do - <<-EOS + <<~EOS I am Sam. Sam I am. Do you like green eggs and ham?