<commit_before>require 'virtual_merchant/amount'

describe VirtualMerchant::Amount, "#amount" do
  it "initiallizes" do
    amount = VirtualMerchant::Amount.new(total: 10.99)
    amount.total.should eq("10.99")
    amount.tax.should eq("0.00")
  end

  it "sets values passed as float to string with 2 decimals" do
    amount = VirtualMerchant::Amount.new(total: 10.9, tax: 0.1)
    amount.total.should eq("10.90")
    amount.tax.should eq("0.10")
  end

  it "accepts decimals passed as strings" do
    amount = VirtualMerchant::Amount.new(total: "10.99", tax: "0.10")
    amount.total.should eq("10.99")
    amount.tax.should eq("0.10")
  end

  it "initializes with recurring data" do
    amount = VirtualMerchant::Amount.new(total: 10.99, next_payment_date: '10/30/13',
                                        billing_cycle: 'MONTHLY')
    amount.total.should eq("10.99")
    amount.tax.should eq("0.00")
    amount.next_payment_date.should eq("10/30/13")
    amount.billing_cycle.should eq("MONTHLY")<commit_msg>Changed date format in test to reflect correct format for billing_cycle<commit_after>require 'virtual_merchant/amount'

describe VirtualMerchant::Amount, "#amount" do
  it "initiallizes" do
    amount = VirtualMerchant::Amount.new(total: 10.99)
    amount.total.should eq("10.99")
    amount.tax.should eq("0.00")
  end

  it "sets values passed as float to string with 2 decimals" do
    amount = VirtualMerchant::Amount.new(total: 10.9, tax: 0.1)
    amount.total.should eq("10.90")
    amount.tax.should eq("0.10")
  end

  it "accepts decimals passed as strings" do
    amount = VirtualMerchant::Amount.new(total: "10.99", tax: "0.10")
    amount.total.should eq("10.99")
    amount.tax.should eq("0.10")
  end

  it "initializes with recurring data" do
    amount = VirtualMerchant::Amount.new(total: 10.99, next_payment_date: '10/30/2013',
                                        billing_cycle: 'MONTHLY')
    amount.total.should eq("10.99")
    amount.tax.should eq("0.00")
    amount.next_payment_date.should eq("10/30/2013")
    amount.billing_cycle.should eq("MONTHLY")
{'fraction_non_alphanumeric': 0.13549618320610687, 'fraction_numerical': 0.060114503816793896, 'mean_word_length': 3.3237113402061857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5406218', 'n_tokens_mistral': 772, 'n_tokens_neox': 686, 'n_words': 163}