Skip to content

Commit

Permalink
Rakefile: Only run cucumber if rspec passes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdippery committed Oct 18, 2016
1 parent b1aa358 commit 3fb9c0c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,36 @@ GEM = "usaidwat-#{USaidWat::VERSION}.gem"

desc "Build usaidwat.gem"
task :build => :perms do
system "gem", "build", GEMSPEC
sh "gem", "build", GEMSPEC
end

desc "Ensure correct permissions for usaidwat.gem"
task :perms do
system "chmod", "-R", "a+rX", *`git ls-files`.chomp.split("\n")
sh "chmod", "-R", "a+rX", *`git ls-files`.chomp.split("\n")
end

desc "Tag the latest version of usaidwat"
task :tag do
system "git", "tag", "-s", "-m", "usaidwat v#{USaidWat::VERSION}", "v#{USaidWat::VERSION}"
sh "git", "tag", "-s", "-m", "usaidwat v#{USaidWat::VERSION}", "v#{USaidWat::VERSION}"
end

desc "Install usaidwat.gem"
task :install => :build do
system "gem", "install", GEM
sh "gem", "install", GEM
end

desc "Push gem to RubyGems"
task :release => [:tag, :build] do
fail 'Cannot release a dev version' if USaidWat::VERSION.end_with?('dev')
system "gem", "push", GEM
sh "gem", "push", GEM
end

desc "Run the test suite"
task :test do
system "bundle", "exec", "rspec"
system "bundle", "exec", "cucumber", "-f", "progress"
sh %{bundle exec rspec} do |ok, _|
fail if !ok
sh 'bundle', 'exec', 'cucumber', '-f', 'progress'
end
end

desc "Clean built products"
Expand Down

0 comments on commit 3fb9c0c

Please sign in to comment.