spec/unit/burndown_data_spec.rb in trollolo-0.1.1 vs spec/unit/burndown_data_spec.rb in trollolo-0.2.0

- old
+ new

@@ -3,100 +3,98 @@ include GivenFilesystemSpecHelpers describe BurndownData do before(:each) do @burndown = BurndownData.new(dummy_settings) - @burndown.board_id = "53186e8391ef8671265eba9d" + @burndown.board_id = '53186e8391ef8671265eba9d' full_board_mock end describe BurndownData::Result do - it "calculates total" do + it 'calculates total' do r = described_class.new r.open = 7 r.done = 4 expect(r.total).to eq 11 end end - describe "setters" do - it "sets open story points" do + describe 'setters' do + it 'sets open story points' do @burndown.story_points.open = 13 expect(@burndown.story_points.open).to eq 13 end - it "sets open tasks" do + it 'sets open tasks' do @burndown.tasks.open = 42 expect(@burndown.tasks.open).to eq 42 end end - describe "#fetch" do - context "with meta data on sprint card" do + describe '#fetch' do + context 'with meta data on sprint card' do before do @burndown.fetch end - it "returns story points" do + it 'returns story points' do expect( @burndown.story_points.total ).to eq 16 expect( @burndown.story_points.open ).to eq 13 expect( @burndown.story_points.done ).to eq 3 end - it "returns extra story points" do + it 'returns extra story points' do expect( @burndown.extra_story_points.total ).to eq 8 expect( @burndown.extra_story_points.open ).to eq 8 expect( @burndown.extra_story_points.done ).to eq 0 end - it "returns unplanned story points" do + it 'returns unplanned story points' do expect( @burndown.unplanned_story_points.total ).to eq 3 expect( @burndown.unplanned_story_points.open ).to eq 1 expect( @burndown.unplanned_story_points.done ).to eq 2 end - it "returns tasks" do + it 'returns tasks' do expect( @burndown.tasks.total ).to eq 13 expect( @burndown.tasks.open ).to eq 9 expect( @burndown.tasks.done ).to eq 4 end - it "returns extra tasks" do + it 'returns extra tasks' do expect( @burndown.extra_tasks.total ).to eq 1 expect( @burndown.extra_tasks.open ).to eq 1 expect( @burndown.extra_tasks.done ).to eq 0 end - it "returns unplanned tasks" do + it 'returns unplanned tasks' do expect( @burndown.unplanned_tasks.total ).to eq 2 expect( @burndown.unplanned_tasks.open ).to eq 1 expect( @burndown.unplanned_tasks.done ).to eq 1 end - it "returns meta data" do - expect( @burndown.meta ).to eq({ - "sprint" => 10, - "total_days" => 18, - "weekend_lines" => [1.5, 6.5, 11.5, 16.5] - }) + it 'returns meta data' do + expect( @burndown.meta ).to eq( 'sprint' => 10, + 'total_days' => 18, + 'weekend_lines' => [1.5, 6.5, 11.5, 16.5]) end - it "saves date and time" do - expected_date_time = DateTime.parse("2015-01-12T13:57:16+01:00") + it 'saves date and time' do + expected_date_time = DateTime.parse('2015-01-12T13:57:16+01:00') allow(DateTime).to receive(:now).and_return(expected_date_time) @burndown.fetch expect(@burndown.date_time).to eq(expected_date_time) end end - context "without meta data on sprint card" do + context 'without meta data on sprint card' do before do allow(Card).to receive(:parse_yaml_from_description).and_return(nil) @burndown.fetch end - it "does not fail" do + it 'does not fail' do expect(@burndown.meta).to be(nil) end end end