Sha256: c2dab1e47fd700642aa69e4ebcd1337a61b454cd9444d9240639731bf1860adc

Contents?: true

Size: 1016 Bytes

Versions: 3

Compression:

Stored size: 1016 Bytes

Contents

require 'rspec'
require_relative '../lib/git_heat/calculator'

describe Calculator do
  it "works" do
    stats = [
      {
        commit: "7c54c33bdd16606118d4c6faa41098ff85635439",
        time: Time.parse("2014-04-19 15:19:17 -0700"),
        affected_files: [
          {file: 'file', insertions: 1, deletions: 0}
        ]
      },
      {
        commit: "c90192a6a40eee00319aa7e9b14fba84816a1697",
        time: Time.parse("2014-04-19 15:20:36 -0700"),
        affected_files: [
          {file: 'file', insertions: 2, deletions: 0},
          {file: 'file2', insertions: 3, deletions: 0}
        ]
      },
      {
        commit: "9bd48ee99f700dd2e42db330b9fc50939fc11634",
        time: Time.parse("2014-04-19 15:31:01 -0700"),
        affected_files: [
          {file: 'file2', insertions: 2, deletions: 2}
        ]
      },
    ]
    Calculator.new(Time.parse("2014-04-20 15:31:01 -0700")).go(stats).should == [
      ["file2", 3.4924976960534404],
      ["file", 1.4921824906831624],
    ]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
git_heat-0.2.0 spec/calculator_spec.rb
git_heat-0.1.0 spec/calculator_spec.rb
git_heat-0.0.1 spec/calculator_spec.rb