Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release task #602

Merged
merged 2 commits into from Oct 5, 2018
Merged

Conversation

hibachrach
Copy link
Contributor

@hibachrach hibachrach commented Sep 13, 2018

Fixes #594

Not exactly sure how to add tests for this (though I'm not sure if they're necessary).

@edwardloveall
Copy link
Member

Awesome @HarrisonB Thanks so much for taking this on! It may take us a couple days to look at this but on first glance it looks like a great start.

Copy link
Member

@paulcsmith paulcsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code here looks perfect. Could you add a spec for it to make sure that it saves the binary? The tricky part will be cleaning up afterward I think. Here is a rough idea of what it might look like:

# Uses the CleanupHelper. Remember to include it: https://github.com/luckyframework/lucky/blob/master/spec/support/cleanup_helper.cr#L6

with_cleanup do
  File.write "./src/server.cr", "1 + 1"

  Release.new.call

  File.exists?("src.server")
end

I think something simple like this is sufficient to make sure the task works. If you want to test the output you could pass in a IO::Memory to initialize, but I don't think that is necessary. It's up to you! Let me know if you have any questions or if I didn't explain things clearly

File.exists?("./server").should be_false
end
end
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice specs!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 😄

@paulcsmith paulcsmith merged commit 164b664 into luckyframework:master Oct 5, 2018
@paulcsmith
Copy link
Member

Thanks for tackling this!

@hibachrach hibachrach deleted the hib-add-release-task branch October 5, 2018 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants