Skip to content

Commit

Permalink
Test #repo_owner
Browse files Browse the repository at this point in the history
  • Loading branch information
cheshire137 committed Nov 26, 2024
1 parent fc8d183 commit fe28fe0
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/lib/project_pull_mover/pull_request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,24 @@ module ProjectPullMover
assert_nil pull.repo_name_with_owner
end
end

describe "#repo_owner" do
it "returns owner login of pull request repository" do
initial_data = {"content" => {"repository" => "someone/somerepo"}}
pull = PullRequest.new(initial_data, options: @options, project: @project, gh_cli: @gh_cli)
assert_equal "someone", pull.repo_owner
end

it "returns nil when repository not given in initial data" do
initial_data = {"content" => {"foo" => "bar"}}
pull = PullRequest.new(initial_data, options: @options, project: @project, gh_cli: @gh_cli)
assert_nil pull.repo_owner
end

it "returns nil when content not given in initial data" do
pull = PullRequest.new({}, options: @options, project: @project, gh_cli: @gh_cli)
assert_nil pull.repo_owner
end
end
end
end

0 comments on commit fe28fe0

Please sign in to comment.