embratel 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm 1.9.2@bell --create
1
+ rvm 1.9.2@embratel --create
@@ -1,3 +1,13 @@
1
+ * 1.1.2
2
+
3
+ #+BEGIN_SRC
4
+ 21a1c1b Version bump.
5
+ ac9b1a3 Fixing PhoneBill#fees memoization.
6
+ a8f265c Updating Gemfile.lock.
7
+ 336aef5 Use our own gem sandbox.
8
+ 5ef1934 Removing unused exception classes.
9
+ #+END_SRC
10
+
1
11
  * 1.1.1
2
12
  #+BEGIN_SRC
3
13
  042f50e Version bump.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- embratel (0.0.2)
4
+ embratel (1.1.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -12,10 +12,8 @@ require File.expand_path('../embratel/csv_parser', __FILE__)
12
12
  require File.expand_path('../embratel/phone_bill', __FILE__)
13
13
 
14
14
  module Embratel
15
- VERSION = '1.1.1'
15
+ VERSION = '1.1.2'
16
16
 
17
- class InvalidPhoneBillFileError < StandardError; end
18
17
  class InvalidRowsError < StandardError; end
19
18
  class NonCSVFileError < StandardError; end
20
- class InvalidCSVFileError < StandardError; end
21
19
  end
@@ -7,11 +7,11 @@ module Embratel
7
7
  end
8
8
 
9
9
  def calls
10
- @calls ||= @payables.select(&:call?)
10
+ @calls ||= payables.select(&:call?)
11
11
  end
12
12
 
13
13
  def fees
14
- @calls ||= @payables.select(&:fee?)
14
+ @fees ||= payables.select(&:fee?)
15
15
  end
16
16
 
17
17
  def total
@@ -21,4 +21,16 @@ class Embratel::PhoneBillTest < Test::Unit::TestCase
21
21
  phone_bill = Embratel::PhoneBill.new(VALID_CSV_PHONE_BILL_FILE_PATH)
22
22
  assert_equal(11.7, phone_bill.total)
23
23
  end
24
+
25
+ def test_fees_after_calls
26
+ phone_bill = Embratel::PhoneBill.new(VALID_CSV_PHONE_BILL_FILE_PATH)
27
+ assert_equal(4, phone_bill.calls.size)
28
+ assert_equal(1, phone_bill.fees.size)
29
+ end
30
+
31
+ def test_calls_after_fees
32
+ phone_bill = Embratel::PhoneBill.new(VALID_CSV_PHONE_BILL_FILE_PATH)
33
+ assert_equal(1, phone_bill.fees.size)
34
+ assert_equal(4, phone_bill.calls.size)
35
+ end
24
36
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: embratel
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.1
5
+ version: 1.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Murilo Pereira
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-22 00:00:00 -03:00
13
+ date: 2011-04-24 00:00:00 -03:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency