Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions spec/overcommit/hook/commit_msg/capitalized_subject_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
subject { described_class.new(config, context) }

before do
subject.stub(:commit_message_lines).and_return(commit_msg.split("\n"))
subject.stub(:empty_message?).and_return(commit_msg.empty?)
context.stub(:commit_message_lines).and_return(commit_msg.split("\n"))
context.stub(:empty_message?).and_return(commit_msg.empty?)
end

context 'when commit message is empty' do
Expand Down
2 changes: 1 addition & 1 deletion spec/overcommit/hook/commit_msg/empty_message_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
subject { described_class.new(config, context) }

before do
subject.stub(:empty_message?).and_return(commit_msg.strip.empty?)
context.stub(:empty_message?).and_return(commit_msg.strip.empty?)
end

context 'when commit message is empty' do
Expand Down
2 changes: 1 addition & 1 deletion spec/overcommit/hook/commit_msg/gerrit_change_id_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
before do
commit_msg_file.write(commit_msg)
commit_msg_file.close
subject.stub(:commit_message_file).and_return(commit_msg_file.path)
context.stub(:commit_message_file).and_return(commit_msg_file.path)
end

context 'when the commit message contains no Change-Id' do
Expand Down
4 changes: 2 additions & 2 deletions spec/overcommit/hook/commit_msg/hard_tabs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
subject { described_class.new(config, context) }

before do
subject.stub(:commit_message).and_return(commit_msg)
subject.stub(:empty_message?).and_return(commit_msg.empty?)
context.stub(:commit_message).and_return(commit_msg)
context.stub(:empty_message?).and_return(commit_msg.empty?)
end

context 'when commit message is empty' do
Expand Down
2 changes: 1 addition & 1 deletion spec/overcommit/hook/commit_msg/russian_novel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
subject { described_class.new(config, context) }

before do
subject.stub(:commit_message_lines).and_return(commit_msg)
context.stub(:commit_message_lines).and_return(commit_msg)
end

context 'when message contains fewer than 30 lines' do
Expand Down
4 changes: 2 additions & 2 deletions spec/overcommit/hook/commit_msg/single_line_subject_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
subject { described_class.new(config, context) }

before do
subject.stub(:commit_message_lines).and_return(commit_msg.split("\n"))
subject.stub(:empty_message?).and_return(commit_msg.empty?)
context.stub(:commit_message_lines).and_return(commit_msg.split("\n"))
context.stub(:empty_message?).and_return(commit_msg.empty?)
end

context 'when commit message is empty' do
Expand Down
4 changes: 2 additions & 2 deletions spec/overcommit/hook/commit_msg/text_width_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
subject { described_class.new(config, context) }

before do
subject.stub(:commit_message_lines).and_return(commit_msg.split("\n"))
subject.stub(:empty_message?).and_return(commit_msg.empty?)
context.stub(:commit_message_lines).and_return(commit_msg.split("\n"))
context.stub(:empty_message?).and_return(commit_msg.empty?)
end

context 'when commit message is empty' do
Expand Down
4 changes: 2 additions & 2 deletions spec/overcommit/hook/commit_msg/trailing_period_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
subject { described_class.new(config, context) }

before do
subject.stub(:commit_message_lines).and_return(commit_msg.split("\n"))
subject.stub(:empty_message?).and_return(commit_msg.empty?)
context.stub(:commit_message_lines).and_return(commit_msg.split("\n"))
context.stub(:empty_message?).and_return(commit_msg.empty?)
end

context 'when commit message is empty' do
Expand Down
2 changes: 1 addition & 1 deletion spec/overcommit/hook/post_commit/git_guilt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

context 'when there is no previous commit' do
before do
subject.stub(:initial_commit?).and_return(true)
context.stub(:initial_commit?).and_return(true)
end

it { should pass }
Expand Down
2 changes: 1 addition & 1 deletion spec/overcommit/hook/pre_push/protected_branches_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

before do
subject.stub(:branches).and_return([protected_branch])
subject.stub(:pushed_refs).and_return([pushed_ref])
context.stub(:pushed_refs).and_return([pushed_ref])
end

context 'when pushing to unprotected branch' do
Expand Down
10 changes: 5 additions & 5 deletions spec/overcommit/hook/pre_rebase/merged_commits_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@

context 'when rebasing a detached HEAD' do
before do
subject.stub(:detached_head?) { true }
context.stub(:detached_head?) { true }
end

it { should pass }
end

context 'when there are no commits to rebase' do
before do
subject.stub(:detached_head?) { false }
subject.stub(:rebased_commits) { [] }
context.stub(:detached_head?) { false }
context.stub(:rebased_commits) { [] }
end

it { should pass }
Expand All @@ -33,8 +33,8 @@
let(:rebased_branch) { 'topic' }

before do
subject.stub(:detached_head?) { false }
subject.stub(:rebased_commits) { [commit_sha1] }
context.stub(:detached_head?) { false }
context.stub(:rebased_commits) { [commit_sha1] }
end

context 'when commits have not yet been merged' do
Expand Down