asonas / chatwork-ruby

MIT License
64 stars 27 forks source link

Relax rspec version #19

Closed sue445 closed 6 years ago

sue445 commented 6 years ago
$ bundle exec rake -T
Install rspec
rake build            # Build chatwork-0.4.1.gem into the pkg directory
rake clean            # Remove any temporary products
rake clobber          # Remove any generated files
rake install          # Build and install chatwork-0.4.1.gem into system gems
rake install:local    # Build and install chatwork-0.4.1.gem into system gems without network access
rake release[remote]  # Create tag v0.4.1 and build and push chatwork-0.4.1.gem to rubygems.org

Modify the Rakefile as follows

$ git diff
diff --git a/Rakefile b/Rakefile
index 667c726..d680e6d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -4,6 +4,6 @@ begin
   require 'rspec/core/rake_task'
   RSpec::Core::RakeTask.new
   task :default => :spec
-rescue
-  $stderr.puts('Install rspec')
+#rescue
+#  $stderr.puts('Install rspec')
 end

Run rake spec

$ bundle exec rake spec
rake aborted!
NoMethodError: undefined method `last_comment' for #<Rake::Application:0x007fd11a147d58>
/Users/sue445/workspace/github.com/asonas/chatwork-ruby/vendor/bundle/ruby/2.4.0/gems/rspec-core-3.1.7/lib/rspec/core/rake_task.rb:104:in `define'
/Users/sue445/workspace/github.com/asonas/chatwork-ruby/vendor/bundle/ruby/2.4.0/gems/rspec-core-3.1.7/lib/rspec/core/rake_task.rb:80:in `initialize'
/Users/sue445/workspace/github.com/asonas/chatwork-ruby/Rakefile:5:in `new'
/Users/sue445/workspace/github.com/asonas/chatwork-ruby/Rakefile:5:in `<top (required)>'
/Users/sue445/workspace/github.com/asonas/chatwork-ruby/vendor/bundle/ruby/2.4.0/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
/Users/sue445/.rbenv/versions/2.4.1/bin/bundle:22:in `load'
/Users/sue445/.rbenv/versions/2.4.1/bin/bundle:22:in `<main>'
(See full trace by running task with --trace)

last_comment is removed since rake v12 https://github.com/ruby/rake/blob/master/History.rdoc#1200

rspec already solves this problem since v3.4.4 https://github.com/rspec/rspec-core/blob/master/Changelog.md#344--2016-03-09

So should use latest rspec