Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Bump diff-lcs to 1.4.4+ #2833

Merged
merged 1 commit into from
Dec 30, 2020
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- 2.3
env:
-
DIFF_LCS_VERSION: "> 1.4.3"
BOGUS: ""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried hard to remove the whole this env block to no avail.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its the matrix.env call, I don't think theres an if in the syntax 😂 I'd just set it to ruby head false or something

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right! I've tried:

  • removing it
  • setting it to an empty array []
  • setting it to an empty hash {}
  • leaving a -

I give up 😆
ruby head false would create a wrong impression that it's there for a good reason, while this non-ambiguously says "some cruft" 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be either something real, or something explicit, however this also needs back porting to rspec-dev, so it can be addressed later.

include:
- ruby: ruby-head
env:
Expand Down
6 changes: 0 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ branch = File.read(File.expand_path("../maintenance-branch", __FILE__)).chomp
end
end

if ENV['DIFF_LCS_VERSION']
gem 'diff-lcs', ENV['DIFF_LCS_VERSION']
else
gem 'diff-lcs', '~> 1.4', '>= 1.4.3'
end

gem 'yard', '~> 0.9.24', :require => false

### deps for rdoc.info
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Feature: Aggregating Failures
end
"""

@skip-when-diff-lcs-1.3
Scenario: Use `aggregate_failures` block form
Given a file named "spec/use_block_form_spec.rb" with:
"""ruby
Expand Down Expand Up @@ -94,81 +93,6 @@ Feature: Aggregating Failures
# ./spec/use_block_form_spec.rb:12
"""

@skip-when-diff-lcs-1.4
Scenario: Use `aggregate_failures` block form
Given a file named "spec/use_block_form_spec.rb" with:
"""ruby
require 'client'

RSpec.describe Client do
after do
# this should be appended to failure list
expect(false).to be(true), "after hook failure"
end

around do |ex|
ex.run
# this should also be appended to failure list
expect(false).to be(true), "around hook failure"
end

it "returns a successful response" do
response = Client.make_request

aggregate_failures "testing response" do
expect(response.status).to eq(200)
expect(response.headers).to include("Content-Type" => "application/json")
expect(response.body).to eq('{"message":"Success"}')
end
end
end
"""
When I run `rspec spec/use_block_form_spec.rb`
Then it should fail and list all the failures:
"""
Failures:

1) Client returns a successful response
Got 3 failures:

1.1) Got 3 failures from failure aggregation block "testing response".
# ./spec/use_block_form_spec.rb:18
# ./spec/use_block_form_spec.rb:10

1.1.1) Failure/Error: expect(response.status).to eq(200)

expected: 200
got: 404

(compared using ==)
# ./spec/use_block_form_spec.rb:19

1.1.2) Failure/Error: expect(response.headers).to include("Content-Type" => "application/json")
expected {"Content-Type" => "text/plain"} to include {"Content-Type" => "application/json"}
Diff:
@@ -1,2 +1,2 @@
-"Content-Type" => "application/json",
+"Content-Type" => "text/plain",
# ./spec/use_block_form_spec.rb:20

1.1.3) Failure/Error: expect(response.body).to eq('{"message":"Success"}')

expected: "{\"message\":\"Success\"}"
got: "Not Found"

(compared using ==)
# ./spec/use_block_form_spec.rb:21

1.2) Failure/Error: expect(false).to be(true), "after hook failure"
after hook failure
# ./spec/use_block_form_spec.rb:6
# ./spec/use_block_form_spec.rb:10

1.3) Failure/Error: expect(false).to be(true), "around hook failure"
around hook failure
# ./spec/use_block_form_spec.rb:12
"""

Scenario: Use `:aggregate_failures` metadata
Given a file named "spec/use_metadata_spec.rb" with:
"""ruby
Expand Down Expand Up @@ -219,7 +143,6 @@ Feature: Aggregating Failures
# ./spec/use_metadata_spec.rb:10
"""

@skip-when-diff-lcs-1.3
Scenario: Enable failure aggregation globally using `define_derived_metadata`
Given a file named "spec/enable_globally_spec.rb" with:
"""ruby
Expand Down Expand Up @@ -274,62 +197,6 @@ Feature: Aggregating Failures
# ./spec/enable_globally_spec.rb:15
"""

@skip-when-diff-lcs-1.4
Scenario: Enable failure aggregation globally using `define_derived_metadata`
Given a file named "spec/enable_globally_spec.rb" with:
"""ruby
require 'client'

RSpec.configure do |c|
c.define_derived_metadata do |meta|
meta[:aggregate_failures] = true
end
end

RSpec.describe Client do
it "returns a successful response" do
response = Client.make_request

expect(response.status).to eq(200)
expect(response.headers).to include("Content-Type" => "application/json")
expect(response.body).to eq('{"message":"Success"}')
end
end
"""
When I run `rspec spec/enable_globally_spec.rb`
Then it should fail and list all the failures:
"""
Failures:

1) Client returns a successful response
Got 3 failures:

1.1) Failure/Error: expect(response.status).to eq(200)

expected: 200
got: 404

(compared using ==)
# ./spec/enable_globally_spec.rb:13

1.2) Failure/Error: expect(response.headers).to include("Content-Type" => "application/json")
expected {"Content-Type" => "text/plain"} to include {"Content-Type" => "application/json"}
Diff:
@@ -1,2 +1,2 @@
-"Content-Type" => "application/json",
+"Content-Type" => "text/plain",
# ./spec/enable_globally_spec.rb:14

1.3) Failure/Error: expect(response.body).to eq('{"message":"Success"}')

expected: "{\"message\":\"Success\"}"
got: "Not Found"

(compared using ==)
# ./spec/enable_globally_spec.rb:15
"""

@skip-when-diff-lcs-1.3
Scenario: Nested failure aggregation works
Given a file named "spec/nested_failure_aggregation_spec.rb" with:
"""ruby
Expand Down Expand Up @@ -394,71 +261,6 @@ Feature: Aggregating Failures
# ./spec/nested_failure_aggregation_spec.rb:14
"""

@skip-when-diff-lcs-1.4
Scenario: Nested failure aggregation works
Given a file named "spec/nested_failure_aggregation_spec.rb" with:
"""ruby
require 'client'

RSpec.describe Client do
it "returns a successful response", :aggregate_failures do
response = Client.make_request

expect(response.status).to eq(200)

aggregate_failures "testing headers" do
expect(response.headers).to include("Content-Type" => "application/json")
expect(response.headers).to include("Content-Length" => "21")
end

expect(response.body).to eq('{"message":"Success"}')
end
end
"""
When I run `rspec spec/nested_failure_aggregation_spec.rb`
Then it should fail and list all the failures:
"""
Failures:

1) Client returns a successful response
Got 3 failures:

1.1) Failure/Error: expect(response.status).to eq(200)

expected: 200
got: 404

(compared using ==)
# ./spec/nested_failure_aggregation_spec.rb:7

1.2) Got 2 failures from failure aggregation block "testing headers".
# ./spec/nested_failure_aggregation_spec.rb:9

1.2.1) Failure/Error: expect(response.headers).to include("Content-Type" => "application/json")
expected {"Content-Type" => "text/plain"} to include {"Content-Type" => "application/json"}
Diff:
@@ -1,2 +1,2 @@
-"Content-Type" => "application/json",
+"Content-Type" => "text/plain",
# ./spec/nested_failure_aggregation_spec.rb:10

1.2.2) Failure/Error: expect(response.headers).to include("Content-Length" => "21")
expected {"Content-Type" => "text/plain"} to include {"Content-Length" => "21"}
Diff:
@@ -1,2 +1,2 @@
-"Content-Length" => "21",
+"Content-Type" => "text/plain",
# ./spec/nested_failure_aggregation_spec.rb:11

1.3) Failure/Error: expect(response.body).to eq('{"message":"Success"}')

expected: "{\"message\":\"Success\"}"
got: "Not Found"

(compared using ==)
# ./spec/nested_failure_aggregation_spec.rb:14
"""

Scenario: Mock expectation failures are aggregated as well
Given a file named "spec/mock_expectation_failure_spec.rb" with:
"""ruby
Expand Down Expand Up @@ -499,7 +301,6 @@ Feature: Aggregating Failures

"""

@skip-when-diff-lcs-1.3
Scenario: Pending integrates properly with aggregated failures
Given a file named "spec/pending_spec.rb" with:
"""ruby
Expand Down Expand Up @@ -549,54 +350,3 @@ Feature: Aggregating Failures
(compared using ==)
# ./spec/pending_spec.rb:10
"""

@skip-when-diff-lcs-1.4
Scenario: Pending integrates properly with aggregated failures
Given a file named "spec/pending_spec.rb" with:
"""ruby
require 'client'

RSpec.describe Client do
it "returns a successful response", :aggregate_failures do
pending "Not yet ready"
response = Client.make_request

expect(response.status).to eq(200)
expect(response.headers).to include("Content-Type" => "application/json")
expect(response.body).to eq('{"message":"Success"}')
end
end
"""
When I run `rspec spec/pending_spec.rb`
Then it should pass and list all the pending examples:
"""
Pending: (Failures listed here are expected and do not affect your suite's status)

1) Client returns a successful response
# Not yet ready
Got 3 failures:

1.1) Failure/Error: expect(response.status).to eq(200)

expected: 200
got: 404

(compared using ==)
# ./spec/pending_spec.rb:8

1.2) Failure/Error: expect(response.headers).to include("Content-Type" => "application/json")
expected {"Content-Type" => "text/plain"} to include {"Content-Type" => "application/json"}
Diff:
@@ -1,2 +1,2 @@
-"Content-Type" => "application/json",
+"Content-Type" => "text/plain",
# ./spec/pending_spec.rb:9

1.3) Failure/Error: expect(response.body).to eq('{"message":"Success"}')

expected: "{\"message\":\"Success\"}"
got: "Not Found"

(compared using ==)
# ./spec/pending_spec.rb:10
"""
17 changes: 0 additions & 17 deletions features/support/diff_lcs_versions.rb

This file was deleted.