Skip to content

Commit

Permalink
Merge pull request #104 from amazing-print/add-merge-queue
Browse files Browse the repository at this point in the history
Update CI for merge queue
  • Loading branch information
paddor authored Jan 9, 2024
2 parents c5733be + 6e0b6c2 commit 25b01d1
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Lints

on:
merge_group:
pull_request:
push:
branches:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Specs

on:
merge_group:
pull_request:
push:
branches:
Expand Down
4 changes: 2 additions & 2 deletions spec/ext/nokogiri_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
it 'colorizes tags' do
xml = Nokogiri::XML('<html><body><h1></h1></body></html>')
# FIXME: Due to something strange with Nokogiri and JRuby, we need to remove extra blank lines.
output = xml.ai.gsub(/\n\n/, "\n")
output = xml.ai.gsub("\n\n", "\n")
expect(output).to eq <<~EOS
<?xml version="1.0"?>\e[1;32m
\e[0m<\e[1;36mhtml\e[0m>\e[1;32m
Expand All @@ -32,7 +32,7 @@
it 'colorizes class and id' do
xml = Nokogiri::XML('<html><body><h1><span class="world" id="hello"></span></h1></body></html>')
# FIXME: Due to something strange with Nokogiri and JRuby, we need to remove extra blank lines.
output = xml.ai.gsub(/\n\n/, "\n")
output = xml.ai.gsub("\n\n", "\n")
expect(output).to eq <<~EOS
<?xml version="1.0"?>\e[1;32m
\e[0m<\e[1;36mhtml\e[0m>\e[1;32m
Expand Down
16 changes: 8 additions & 8 deletions spec/formats_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,13 @@

#------------------------------------------------------------------------------
describe 'File' do
it 'displays a file (plain)', unix: true do
it 'displays a file (plain)', :unix do
File.open(__FILE__, 'r') do |f|
expect(f.ai(plain: true)).to eq("#{f.inspect}\n" + `ls -alF #{f.path}`.chop)
end
end

it 'displays a file (plain) akin to powershell Get-ChildItem', mswin: true do
it 'displays a file (plain) akin to powershell Get-ChildItem', :mswin do
File.open(__FILE__, 'r') do |f|
expect(f.ai(plain: true)).to eq("#{f.inspect}\n" + AmazingPrint::Formatters::GetChildItem.new(f.path).to_s)
end
Expand All @@ -514,13 +514,13 @@

#------------------------------------------------------------------------------
describe 'Dir' do
it 'displays a direcory (plain)', unix: true do
it 'displays a direcory (plain)', :unix do
Dir.open(File.dirname(__FILE__)) do |d|
expect(d.ai(plain: true)).to eq("#{d.inspect}\n" + `ls -alF #{d.path}`.chop)
end
end

it 'displays a directory (plain) akin to powershell Get-ChildItem', mswin: true do
it 'displays a directory (plain) akin to powershell Get-ChildItem', :mswin do
Dir.open(File.dirname(__FILE__)) do |d|
expect(d.ai(plain: true)).to eq("#{d.inspect}\n" + AmazingPrint::Formatters::GetChildItem.new(d.path).to_s)
end
Expand Down Expand Up @@ -684,7 +684,7 @@ class My < Hash; end
EOS
end

it 'inherited from File should be displayed as File', unix: true do
it 'inherited from File should be displayed as File', :unix do
class My < File; end

my = begin
Expand All @@ -695,21 +695,21 @@ class My < File; end
expect(my.ai(plain: true)).to eq("#{my.inspect}\n" + `ls -alF #{my.path}`.chop)
end

it 'inherited from File should be displayed as File', mswin: true do
it 'inherited from File should be displayed as File', :mswin do
class My < File; end
my = My.new('nul') # it's /dev/null in Windows
expect(my.ai(plain: true)).to eq("#{my.inspect}\n" + AmazingPrint::Formatters::GetChildItem.new(my.path).to_s)
end

it 'inherited from Dir should be displayed as Dir', unix: true do
it 'inherited from Dir should be displayed as Dir', :unix do
class My < Dir; end

require 'tmpdir'
my = My.new(Dir.tmpdir)
expect(my.ai(plain: true)).to eq("#{my.inspect}\n" + `ls -alF #{my.path}`.chop)
end

it 'inherited from Dir are displayed as Dir', mswin: true do
it 'inherited from Dir are displayed as Dir', :mswin do
class My < Dir; end

require 'tmpdir'
Expand Down

0 comments on commit 25b01d1

Please sign in to comment.