-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a312a8d
commit d51b358
Showing
5 changed files
with
45 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
require 'minitest_helper' | ||
|
||
class FlavorGem::Bump | ||
public :add_bump_tasks, :remove_bump_tasks | ||
end | ||
|
||
class TestBump < Minitest::Test | ||
def setup | ||
@bump = FlavorGem::Bump.new | ||
end | ||
|
||
def gem_tasks | ||
'require "flavor_gem/gem_tasks"' | ||
def bump_tasks_regex | ||
/require ["']flavor_gem\/bump_tasks["']/ | ||
end | ||
|
||
# test "should delete bump task from Rakefile" do | ||
# @bump.delete | ||
# rakefile = File.read "Rakefile" | ||
# refute_match /#{gem_tasks}/, rakefile | ||
# end | ||
test "should add and delete bump task from Rakefile" do | ||
rakefile_name = "lib/flavor_gem/template/Rakefile" | ||
|
||
# test "should add bump task into Rakefile" do | ||
# @bump.generate | ||
# rakefile = File.read "Rakefile" | ||
# assert_match /flavor_gem\/gem_tasks/, rakefile | ||
# end | ||
@bump.add_bump_tasks rakefile_name | ||
rakefile = File.read rakefile_name | ||
assert_match bump_tasks_regex, rakefile | ||
|
||
@bump.remove_bump_tasks rakefile_name | ||
rakefile = File.read rakefile_name | ||
refute_match bump_tasks_regex, rakefile | ||
end | ||
end |