Skip to content

Commit

Permalink
Skip integration tests in CI environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Sep 19, 2024
1 parent bac848e commit 9c6be48
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spec/jekyll-admin/integration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
let(:path) { "/" }
let(:uri) { URI.join(server, path) }
let(:response) { Net::HTTP.get_response(uri) }
let(:skip_condition) { Gem.win_platform? || ENV["CI"] }

before do
Open3.popen3(*start_command)
Expand All @@ -23,7 +24,7 @@
context "Jekyll site" do
let(:path) { "/" }

it "serves the Jekyll site", :skip => Gem.win_platform? do
it "serves the Jekyll site", :skip => skip_condition do
expect(response.code).to eql("200")
expect(response.body).to match("You're probably looking for")
end
Expand All @@ -32,7 +33,7 @@
context "Admin site" do
let(:path) { "/admin" }

it "serves the Jekyll site", :skip => Gem.win_platform? do
it "serves the Jekyll site", :skip => skip_condition do
with_index_stubbed do
expect(response.code).to eql("200")
expect(response.body).to match("Jekyll Admin")
Expand All @@ -43,14 +44,14 @@
context "API" do
let(:path) { "/_api" }

it "serves the Jekyll site", :skip => Gem.win_platform? do
it "serves the Jekyll site", :skip => skip_condition do
expect(response.code).to eql("200")
expect(response.body).to match("collections_api")
end
end

context "watching" do
it "Jekyll isn't watching", :skip => Gem.win_platform? do
it "Jekyll isn't watching", :skip => skip_condition do
File.open(File.join(source, "page.md"), "a") do |f|
f.puts "peek-a-boo"
end
Expand Down

0 comments on commit 9c6be48

Please sign in to comment.