shushu 0.1.16 → 1.0.0rc1

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.
@@ -1,22 +0,0 @@
1
- require File.expand_path('../../test_helper', __FILE__)
2
-
3
- class ReportPresenterTest < ShushuTest
4
-
5
- def report
6
- Shushu::Report.new.tap do |r|
7
- r.billable_units = Fixtures.billable_units.map {|h| Shushu::BillableUnit.new(h)}
8
- end
9
- end
10
-
11
- def test_init
12
- presenter = Shushu::ReportPresenter.new(report)
13
- assert(!presenter.nil?)
14
- end
15
-
16
- def test_returns_line_item_presenters
17
- presenter = Shushu::ReportPresenter.new(report)
18
- lip = presenter.line_item_presenters
19
- assert_equal(Shushu::LineItemPresenter, lip.first.class)
20
- end
21
-
22
- end
@@ -1,30 +0,0 @@
1
- require File.expand_path('../../test_helper', __FILE__)
2
-
3
- class LineItemBuilderTest < ShushuTest
4
-
5
- def units
6
- Fixtures.billable_units.map {|h| Shushu::BillableUnit.new(h)}
7
- end
8
-
9
- def test_build
10
- line_items = Shushu::LineItemBuilder.build(units)
11
- assert(!line_items.nil?)
12
- end
13
-
14
- def test_build_creates_line_item_by_hid
15
- line_items = Shushu::LineItemBuilder.build(units)
16
- assert_equal(1, line_items.length)
17
- end
18
-
19
- def test_build_creates_one_unit_group_for_line_item
20
- line_item = Shushu::LineItemBuilder.build(units).pop
21
- assert_equal(1, line_item.unit_groups.length)
22
- end
23
-
24
- def test_build_puts_both_units_on_unit_group
25
- line_item = Shushu::LineItemBuilder.build(units).pop
26
- unit_group = line_item.unit_groups.pop
27
- assert_equal(2, unit_group.units.length)
28
- end
29
-
30
- end