Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
zupzup committed Jun 2, 2017
1 parent 92fb07a commit 948ed88
Show file tree
Hide file tree
Showing 115 changed files with 11,569 additions and 216,015 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ _testmain.go
*.sh
.caloriesconf
calories
dist
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
notifications:
email: true
go:
- 1.7
- 1.8
- tip
install:
- go get github.com/golang/lint/golint
- go get github.com/mattn/go-sqlite3
script:
- go build -v
- go vet $(go list ./... | grep -v vendor)
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,18 @@ Features
Installation
-------------

Using Go:

```
go get github.com/zupzup/calories
```

Or with the released [Binaries](https://github.com/zupzup/calories/releases) for

* OS X (32-bit, 64 bit)
* Windows (32-bit, 64 bit)
* Linux (32-bit, 64 bit)

Getting Started
---------------

Expand Down
16 changes: 8 additions & 8 deletions command/day_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func TestExecuteDayWeekSuccessEmpty(t *testing.T) {
exps := make(mock.Expectations)
for i := 0; i <= 31; i++ {
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
}
c := DayCommand{
DataSource: &mock.DataSource{Expectations: exps},
Expand Down Expand Up @@ -45,7 +45,7 @@ func TestExecuteDayWeekFetchFail(t *testing.T) {
func TestExecuteDayWeekSuccessEntries(t *testing.T) {
exps := make(mock.Expectations)
for i := 0; i <= 31; i++ {
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
}
c := DayCommand{
DataSource: &mock.DataSource{Expectations: exps},
Expand All @@ -62,7 +62,7 @@ func TestExecuteDayWeekSuccessEntries(t *testing.T) {
func TestExecuteDayMonthSuccess(t *testing.T) {
exps := make(mock.Expectations)
for i := 0; i <= 31; i++ {
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
}
c := DayCommand{
DataSource: &mock.DataSource{Expectations: exps},
Expand All @@ -79,7 +79,7 @@ func TestExecuteDayMonthSuccess(t *testing.T) {

func TestExecuteDayDateSuccess(t *testing.T) {
exps := make(mock.Expectations)
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
c := DayCommand{
DataSource: &mock.DataSource{Expectations: exps},
Renderer: &mock.Renderer{},
Expand All @@ -97,7 +97,7 @@ func TestExecuteDayDateSuccess(t *testing.T) {

func TestExecuteDayFalseDate(t *testing.T) {
exps := make(mock.Expectations)
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
c := DayCommand{
DataSource: &mock.DataSource{Expectations: exps},
Renderer: &mock.Renderer{},
Expand All @@ -116,7 +116,7 @@ func TestExecuteDayFalseDate(t *testing.T) {

func TestExecuteDayNoDateSuccess(t *testing.T) {
exps := make(mock.Expectations)
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
c := DayCommand{
DataSource: &mock.DataSource{Expectations: exps},
Renderer: &mock.Renderer{},
Expand All @@ -135,7 +135,7 @@ func TestExecuteDayNoDateSuccess(t *testing.T) {
func TestExecuteDayHistorySuccess(t *testing.T) {
exps := make(mock.Expectations)
for i := 0; i <= 6; i++ {
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
}
c := DayCommand{
DataSource: &mock.DataSource{Expectations: exps},
Expand All @@ -154,7 +154,7 @@ func TestExecuteDayHistorySuccess(t *testing.T) {
func TestExecuteDayHistoryMinusSuccess(t *testing.T) {
exps := make(mock.Expectations)
for i := 0; i <= 6; i++ {
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
}
c := DayCommand{
DataSource: &mock.DataSource{Expectations: exps},
Expand Down
2 changes: 1 addition & 1 deletion command/entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func clearSingleEntry(ds datasource.DataSource, r renderer.Renderer, yesMode boo
if err != nil {
return "", err
}
return r.ClearEntry(formattedDate, entry)
return r.ClearEntry(formattedDate, &entry)
}

// clearAllEntries deletes all entries for a given day, after asking the user
Expand Down
6 changes: 3 additions & 3 deletions command/entry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestExecuteEntriesClearZeroEntries(t *testing.T) {

func TestExecuteEntriesClearTooFewEntries(t *testing.T) {
exps := make(mock.Expectations)
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
c := ClearEntriesCommand{
DataSource: &mock.DataSource{Expectations: exps},
Renderer: &mock.Renderer{},
Expand All @@ -57,7 +57,7 @@ func TestExecuteEntriesClearTooFewEntries(t *testing.T) {

func TestExecuteEntriesClearZeroPosition(t *testing.T) {
exps := make(mock.Expectations)
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
c := ClearEntriesCommand{
DataSource: &mock.DataSource{Expectations: exps},
Renderer: &mock.Renderer{},
Expand All @@ -74,7 +74,7 @@ func TestExecuteEntriesClearZeroPosition(t *testing.T) {

func TestExecuteEntriesClearSuccess(t *testing.T) {
exps := make(mock.Expectations)
exps.Add("FetchEntries", nil, model.Entries{&model.Entry{}})
exps.Add("FetchEntries", nil, model.Entries{model.Entry{}})
exps.Add("RemoveEntry", nil, nil)
c := ClearEntriesCommand{
DataSource: &mock.DataSource{Expectations: exps},
Expand Down
81 changes: 0 additions & 81 deletions command/import_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions command/weight_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func TestExecuteWeightNoAdd(t *testing.T) {
var weights []*model.Weight
var weights []model.Weight
exps := make(mock.Expectations)
exps.Add("FetchConfig", nil, &model.Config{})
exps.Add("FetchWeights", nil, weights)
Expand All @@ -27,7 +27,7 @@ func TestExecuteWeightNoAdd(t *testing.T) {
func TestExecuteWeightBrokenWeights(t *testing.T) {
exps := make(mock.Expectations)
exps.Add("FetchConfig", nil, &model.Config{})
exps.Add("FetchWeights", []*model.Weight{}, errors.New("err"))
exps.Add("FetchWeights", []model.Weight{}, errors.New("err"))
c := WeightCommand{
DataSource: &mock.DataSource{Expectations: exps},
Renderer: &mock.Renderer{},
Expand Down
Loading

0 comments on commit 948ed88

Please sign in to comment.