Module: Generalis::RSpec::FormatHelper
- Defined in:
- lib/rspec/helpers/format_helper.rb
Instance Method Summary collapse
Instance Method Details
#format_account(account) ⇒ String
14 15 16 17 18 19 |
# File 'lib/rspec/helpers/format_helper.rb', line 14 def format_account(account) text = "#{account.class}[:#{account.name}]" text += " (Owner: #{account.owner.class} #{account.owner.id})" if account.owner text end |
#format_entry(entry) ⇒ String
8 9 10 |
# File 'lib/rspec/helpers/format_helper.rb', line 8 def format_entry(entry) "\t#{format_money(entry.amount)} to #{format_account(entry.account)}" end |
#format_money(money) ⇒ String
23 24 25 |
# File 'lib/rspec/helpers/format_helper.rb', line 23 def format_money(money) "#{money.format} (#{money.currency})" end |