Skip to content

Commit

Permalink
Merge pull request xing#3 from alto/fix_specs
Browse files Browse the repository at this point in the history
fix specs, because the original Gemfile.lock has never been committed or pushed (got ignored in .gitignore)
  • Loading branch information
alto committed Feb 19, 2014
2 parents 5904ec6 + 601fbde commit 5dc1f1e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions spec/dependency_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ module GemVersionCheck
describe Dependency do

context "#check" do
let(:lock_file) { Lockfile.new(lock_file_content("Gemfile.lock")) }
let(:lock_file) { Lockfile.new(lock_file_content("rails_app_example.lock")) }

let(:dependency) { Dependency.new("activesupport", "3.2.8") }
let(:invalid_dependency) { Dependency.new("activesupport", "3.2.9") }
let(:not_used_dependency) { Dependency.new("exceptionist", "3.2.8") }

let(:dependency) { Dependency.new("activesupport", "3.2.9") }
let(:invalid_dependency) { Dependency.new("activesupport", "3.2.10") }
let(:not_used_dependency) { Dependency.new("rails", "3.2.9") }

context "#valid?" do
it "is valid if current version == expected version" do
dependency.check(lock_file)
Expand Down Expand Up @@ -42,7 +42,7 @@ module GemVersionCheck
end

it "returns true if gem was not found on gems server" do
dep = Dependency.new("non_existing_gem")
dep = Dependency.new("non_existing_gem")
dep.expects(:retrieve_spec).returns(nil)
dep.check(lock_file)

Expand Down
2 changes: 1 addition & 1 deletion spec/lockfile_fetch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module GemVersionCheck
context "#lock_file" do
it "downloads lock file content and returns lock_file" do
fetcher = LockfileFetcher.new(redirect_url)
fetcher.expects(:request).returns(lock_file_content("Gemfile.lock"))
fetcher.expects(:request).returns(lock_file_content("rails_app_example.lock"))
Bundler::LockfileParser.new(fetcher.content).specs.size.should > 0
end

Expand Down
8 changes: 4 additions & 4 deletions spec/lockfile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@

module GemVersionCheck
describe Lockfile do
let(:lockfile) { Lockfile.new(lock_file_content("Gemfile.lock")) }
let(:lockfile) { Lockfile.new(lock_file_content("rails_app_example.lock")) }

describe "#spec_names" do
it "returns all spec names" do
lockfile.spec_names.size.should == 12
lockfile.spec_names.size.should == 47
lockfile.spec_names.should include("activesupport")
end
end

describe "#version_for" do
it "returns spec for name" do
lockfile.version_for("activesupport").should == "3.2.9"
lockfile.version_for("activesupport").should == "3.2.8"
end

it "returns nil if spec does not exist" do
Expand All @@ -24,7 +24,7 @@ module GemVersionCheck

describe "#total" do
it "returns total number of spec" do
lockfile.total.should == 12
lockfile.total.should == 47
end
end
end
Expand Down

0 comments on commit 5dc1f1e

Please sign in to comment.