diff --git a/lib/appraisal/bundler_dsl.rb b/lib/appraisal/bundler_dsl.rb index e102f4cd..dbb82d4b 100644 --- a/lib/appraisal/bundler_dsl.rb +++ b/lib/appraisal/bundler_dsl.rb @@ -65,8 +65,9 @@ def source(source, &block) end end - def ruby(ruby_version) + def ruby(ruby_version = nil, **kwargs) @ruby_version = ruby_version + @ruby_version = kwargs unless ruby_version end def git(source, options = {}, &block) diff --git a/spec/appraisal/gemfile_spec.rb b/spec/appraisal/gemfile_spec.rb index 666c07ba..d5a869d5 100644 --- a/spec/appraisal/gemfile_spec.rb +++ b/spec/appraisal/gemfile_spec.rb @@ -440,4 +440,17 @@ expect(gemfile.load(tmpfile.path)).to include(File.dirname(tmpfile.path)) end end + + it "supports the ruby file: syntax" do + gemfile = Appraisal::Gemfile.new + + gemfile.ruby file: ".ruby-version" + gemfile.source "one" + + expect(gemfile.to_s).to eq <<-GEMFILE.strip_heredoc.strip + source "one" + + ruby {:file=>".ruby-version"} + GEMFILE + end end