spec/owners_cli_spec.rb in owners-0.0.8 vs spec/owners_cli_spec.rb in owners-0.0.9
- old
+ new
@@ -20,27 +20,48 @@
expect(subject).to eq("@org/auth\n@org/blog\n")
end
end
context "with a specified file" do
- before { args << "--file" << "SOMETHING_ELSE" }
+ before { args << "-f" << "SOMETHING_ELSE" }
it "overrides the default OWNERS filename" do
begin
expect(subject).to eq("")
ensure
Owners.file = nil
end
end
end
+
+ context "without debugging" do
+ before { args << "-d" }
+
+ it "parses owners correctly" do
+ expected = <<-OUTPUT
+@org/auth
+group
+ example/app/controllers/users_controller.rb
+ example/app/OWNERS:1 => (?-mix:user)
+
+@org/blog
+group
+ example/app/controllers/users_controller.rb
+ example/OWNERS:2 => (?-mix:.*)
+
+ OUTPUT
+
+ expect(subject).to eq(expected)
+ end
+ end
end
describe "for_diff" do
let(:args) { ["for_diff", "781b3b2", "ba7cd78"] }
context "without a specified file" do
it "parses owners correctly" do
- expect(subject).to eq("@org/blog\n@whitespace\ndata@example.com\n")
+ expect(subject).to eq("@org/blog\ndata@example.com\n@whitespace\n")
end
end
context "with a specified file" do
before { args << "--file" << "SOMETHING_ELSE" }