Module: Generalis::RSpec::FormatHelper

Defined in:
lib/rspec/helpers/format_helper.rb

Instance Method Summary collapse

Instance Method Details

#format_account(account) ⇒ String

Parameters:

Returns:

  • (String)


14
15
16
17
18
19
# File 'lib/rspec/helpers/format_helper.rb', line 14

def ()
  text  = "#{.class}[:#{.name}]"
  text += " (Owner: #{.owner.class} #{.owner.id})" if .owner

  text
end

#format_entry(entry) ⇒ String

Parameters:

Returns:

  • (String)


8
9
10
# File 'lib/rspec/helpers/format_helper.rb', line 8

def format_entry(entry)
  "\t#{format_money(entry.amount)} to #{(entry.)}"
end

#format_money(money) ⇒ String

Parameters:

  • money (Money)

Returns:

  • (String)


23
24
25
# File 'lib/rspec/helpers/format_helper.rb', line 23

def format_money(money)
  "#{money.format} (#{money.currency})"
end