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

Update to the latest version of RSpec and Bundler. #131

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
rvm:
- "3.2"
- "3.1"
- "3.0"
- "2.7"
- "2.6"
- "2.5"
- "2.4"
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ gemspec

group :test do
gem "rake"
gem "rspec", "~> 2"
gem "rspec-core", "~> 2"
gem "rspec", "~> 3"
gem "rspec-core", "~> 3"
gem "rexml"
gem "mocha"
gem "rack", ">= 1.6.11"
end
41 changes: 25 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
PATH
remote: .
specs:
imgkit (1.6.2)
imgkit (1.6.3)

GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.1.2)
mocha (0.9.12)
rack (2.0.6)
rake (0.9.2.2)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
diff-lcs (1.5.0)
mocha (2.1.0)
ruby2_keywords (>= 0.0.5)
rack (3.0.8)
rake (13.0.6)
rexml (3.2.6)
rspec (3.12.0)
rspec-core (~> 3.12.0)
rspec-expectations (~> 3.12.0)
rspec-mocks (~> 3.12.0)
rspec-core (3.12.2)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.6)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-support (3.12.1)
ruby2_keywords (0.0.5)

PLATFORMS
ruby
Expand All @@ -27,8 +35,9 @@ DEPENDENCIES
mocha
rack (>= 1.6.11)
rake
rspec (~> 2)
rspec-core (~> 2)
rexml
rspec (~> 3)
rspec-core (~> 3)

BUNDLED WITH
2.1.4
2.4.19
30 changes: 15 additions & 15 deletions spec/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,51 +7,51 @@
let(:system_path_with_bundler_warning) { "`/` is not writable.\nBundler will use `/tmp/bundler/home/unknown' as your home directory temporarily.\n/path/to/wkhtmltoimage\n" }

before(:each) do
subject.stub :` => system_path
allow(subject).to receive(:`).and_return(system_path)
end

context "with Bundler" do
before(:each) do
subject.stub :using_bundler? => true
allow(subject).to receive(:using_bundler?).and_return(true)
end

it "should return the result of `bundle exec which wkhtmltoimage` with whitespace stripped" do
subject.should_receive(:`).with("bundle exec which wkhtmltoimage")
subject.wkhtmltoimage.should == system_path.chomp
expect(subject).to receive(:`).with("bundle exec which wkhtmltoimage")
expect(subject.wkhtmltoimage).to eq system_path.chomp
end

context "with warning" do
before(:each) do
subject.stub :` => system_path_with_bundler_warning
allow(subject).to receive(:`).and_return(system_path_with_bundler_warning)
end

it "should return the result of `bundle exec which wkhtmltoimage` with warning stripped" do
subject.should_receive(:`).with("bundle exec which wkhtmltoimage")
subject.wkhtmltoimage.should == system_path.chomp
expect(subject).to receive(:`).with("bundle exec which wkhtmltoimage")
expect(subject.wkhtmltoimage).to eq system_path.chomp
end
end
end

context "without Bundler" do
before(:each) do
subject.stub :using_bundler? => false
allow(subject).to receive(:using_bundler?).and_return(false)
end

it "should return the result of `which wkhtmltoimage` with whitespace stripped" do
subject.should_receive(:`).with("which wkhtmltoimage")
subject.wkhtmltoimage.should == system_path.chomp
expect(subject).to receive(:`).with("which wkhtmltoimage")
expect(subject.wkhtmltoimage).to eq system_path.chomp
end
end
end

context "system version does not exist" do
before(:each) do
subject.stub :` => "\n"
subject.stub :using_bundler? => false
allow(subject).to receive(:`).and_return("\n")
allow(subject).to receive(:using_bundler?).and_return(false)
end

it "should return the fallback path" do
subject.wkhtmltoimage.should == "/usr/local/bin/wkhtmltoimage"
expect(subject.wkhtmltoimage).to eq "/usr/local/bin/wkhtmltoimage"
end
end

Expand All @@ -63,8 +63,8 @@
end

it "should not check the system version and return the explicit path" do
subject.should_not_receive(:`)
subject.wkhtmltoimage.should == explicit_path
expect(subject).to_not receive(:`)
expect(subject.wkhtmltoimage).to eq explicit_path
end
end
end
Expand Down