Skip to content

Commit 155d62e

Browse files
committed
Create test and fixtures demonstrating Fixnum regression
1 parent a64adc3 commit 155d62e

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"document_type": "Catalog",
3+
"data": {
4+
"name": "octoawesome-fe-00decaf.example.com",
5+
"version": "",
6+
"environment": "production",
7+
"resources": [
8+
{
9+
"type": "Special",
10+
"title": "My::Silly::Class",
11+
"tags": [
12+
"class",
13+
"my::silly::class",
14+
"my",
15+
"silly",
16+
"class"
17+
],
18+
"exported": false,
19+
"parameters": {
20+
"number_one": 7199,
21+
"number_two": 2181
22+
}
23+
}
24+
]
25+
}
26+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"document_type": "Catalog",
3+
"data": {
4+
"name": "octoawesome-fe-00decaf.example.com",
5+
"version": "",
6+
"environment": "production",
7+
"resources": [
8+
{
9+
"type": "Special",
10+
"title": "My::Silly::Class",
11+
"tags": [
12+
"class",
13+
"my::silly::class",
14+
"my",
15+
"silly",
16+
"class"
17+
],
18+
"exported": false,
19+
"parameters": {
20+
"number_one": 7199,
21+
"number_two": 2181,
22+
"number_three": 1234,
23+
"string": "boom"
24+
}
25+
}
26+
]
27+
}
28+
}

spec/octocatalog-diff/integration/regressions_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,18 @@
2525
expect(@result[:diffs].size).to eq(0), @result[:diffs].map(&:inspect).join("\n")
2626
end
2727
end
28+
29+
describe 'resource with Fixnum parameters added' do
30+
before(:all) do
31+
@result = OctocatalogDiff::Integration.integration(
32+
from_catalog: OctocatalogDiff::Spec.fixture_path('catalogs/regression-fixnum-1.json'),
33+
to_catalog: OctocatalogDiff::Spec.fixture_path('catalogs/regression-fixnum-2.json')
34+
)
35+
end
36+
37+
it 'should run without an error' do
38+
expect(@result[:exitcode]).not_to eq(-1), "Internal error: #{OctocatalogDiff::Integration.format_exception(@result)}"
39+
expect(@result[:exitcode]).to eq(2), "Runtime error: #{@result[:logs]}"
40+
expect(@result[:diffs].size).to eq(1), @result[:diffs].map(&:inspect).join("\n")
41+
end
42+
end

0 commit comments

Comments
 (0)