Permalink
Browse files

Merge pull request #187 from x3ro/rspec-be-true-weirdness

Rspec be true weirdness
  • Loading branch information...
2 parents 3274e65 + 940b62c commit 8c4b8a097615e19bb834c4585a70f801a09d3eab @pengwynn pengwynn committed Dec 3, 2012
Showing with 13 additions and 13 deletions.
  1. +1 −1 lib/octokit/client/repositories.rb
  2. +12 −12 spec/octokit/client/repositories_spec.rb
@@ -302,7 +302,7 @@ def add_collaborator(repo, collaborator, options={})
# @example
# @client.remove_collab('pengwynn/octokit', 'holman')
def remove_collaborator(repo, collaborator, options={})
- request :delete, "repos/#{Repository.new repo}/collaborators/#{collaborator}", options
+ request(:delete, "repos/#{Repository.new repo}/collaborators/#{collaborator}", options).status == 204
end
alias :remove_collab :remove_collaborator
@@ -84,7 +84,7 @@
it "stars a repository" do
stub_put("/user/starred/sferik/rails_admin").
to_return(:status => 204)
- expect(@client.star("sferik/rails_admin")).to be_true
+ expect(@client.star("sferik/rails_admin")).to eq(true)
end
end
@@ -94,7 +94,7 @@
it "unstars a repository" do
stub_delete("/user/starred/sferik/rails_admin").
to_return(:status => 204)
- expect(@client.unstar("sferik/rails_admin")).to be_true
+ expect(@client.unstar("sferik/rails_admin")).to eq(true)
end
end
@@ -104,7 +104,7 @@
it "watches a repository" do
stub_put("/user/watched/sferik/rails_admin").
to_return(:status => 204)
- expect(@client.watch("sferik/rails_admin")).to be_true
+ expect(@client.watch("sferik/rails_admin")).to eq(true)
end
end
@@ -114,7 +114,7 @@
it "unwatches a repository" do
stub_delete("/user/watched/sferik/rails_admin").
to_return(:status => 204)
- expect(@client.unwatch("sferik/rails_admin")).to be_true
+ expect(@client.unwatch("sferik/rails_admin")).to eq(true)
end
end
@@ -157,7 +157,7 @@
stub_delete("/repos/sferik/rails_admin").
to_return(:status => 204, :body => "")
result = @client.delete_repository("sferik/rails_admin")
- expect(result).to be_true
+ expect(result).to eq(true)
end
end
@@ -216,7 +216,7 @@
stub_delete("/repos/sferik/rails_admin/keys/#{103205}").
to_return(:status => 204)
result = @client.remove_deploy_key("sferik/rails_admin", 103205)
- expect(result).to be_true
+ expect(result).to eq(true)
end
end
@@ -238,7 +238,7 @@
stub_put("/repos/sferik/rails_admin/collaborators/sferik").
to_return(:status => 204)
result = @client.add_collaborator("sferik/rails_admin", "sferik")
- expect(result).to be_true
+ expect(result).to eq(true)
end
end
@@ -249,7 +249,7 @@
stub_delete("/repos/sferik/rails_admin/collaborators/sferik").
to_return(:status => 204)
result = @client.remove_collaborator("sferik/rails_admin", "sferik")
- expect(result).to be_true
+ expect(result).to eq(true)
end
end
@@ -420,7 +420,7 @@
it "removes a hook" do
stub_delete("/repos/railsbp/railsbp.com/hooks/154284").
to_return(:status => 204)
- expect(@client.remove_hook("railsbp/railsbp.com", 154284)).to be_true
+ expect(@client.remove_hook("railsbp/railsbp.com", 154284)).to eq(true)
end
end
@@ -430,7 +430,7 @@
it "tests a hook" do
stub_post("/repos/railsbp/railsbp.com/hooks/154284/test").
to_return(:status => 204)
- expect(@client.test_hook("railsbp/railsbp.com", 154284)).to be_true
+ expect(@client.test_hook("railsbp/railsbp.com", 154284)).to eq(true)
end
end
@@ -476,7 +476,7 @@
stub_get("/repos/pengwynn/octokit/subscription").
to_return(json_response("subscription.json"))
subscription = @client.subscription("pengwynn/octokit")
- expect(subscription.subscribed).to be_true
+ expect(subscription.subscribed).to eq(true)
end
end
@@ -498,7 +498,7 @@
stub_delete("/repos/pengwynn/octokit/subscription").
to_return(:status => 204)
result = @client.delete_subscription("pengwynn/octokit")
- expect(result).to be_true
+ expect(result).to eq(true)
end
it "returns false when delete repo subscription fails" do

0 comments on commit 8c4b8a0

Please sign in to comment.