|
1611 | 1611 | end
|
1612 | 1612 | end
|
1613 | 1613 | end
|
| 1614 | + |
| 1615 | + context 'use_lcs is taken into account' do |
| 1616 | + describe '#ignore' do |
| 1617 | + before(:all) do |
| 1618 | + r1 = [ |
| 1619 | + { |
| 1620 | + 'type' => 'Example1', 'title' => 'main', 'tags' => ['stage'], 'exported' => false, |
| 1621 | + 'parameters' => { |
| 1622 | + 'name' => 'main', 'toplevel' => 'toplevel attribute', |
| 1623 | + 'nest' => { |
| 1624 | + 'toplevel' => 'toplevel_nest attribute', |
| 1625 | + 'nest' => { 'nest' => 'nested nested text' }, |
| 1626 | + 'nest2' => { 'chicken' => 'egg' }, |
| 1627 | + 'chicken' => 'egg' |
| 1628 | + } |
| 1629 | + } |
| 1630 | + } |
| 1631 | + ] |
| 1632 | + @c1 = OctocatalogDiff::Spec.build_catalog(r1) |
| 1633 | + @c2 = OctocatalogDiff::Spec.build_catalog(r1) |
| 1634 | + end |
| 1635 | + |
| 1636 | + it 'should honor the algo configuration passed in the options (false)' do |
| 1637 | + logger, logger_str = OctocatalogDiff::Spec.setup_logger |
| 1638 | + opts = { use_lcs: false, logger: logger } |
| 1639 | + testobj = OctocatalogDiff::CatalogDiff::Differ.new(opts, @c1, @c2) |
| 1640 | + testobj.diff |
| 1641 | + expect(logger_str.string).to match(/Entering hashdiff_initial; catalog sizes: 1, 1/) |
| 1642 | + expect(logger_str.string).to match(/HashDiff configuration: \(use_lcs: false\)/) |
| 1643 | + end |
| 1644 | + |
| 1645 | + it 'should honor the algo configuration passed in the options (true)' do |
| 1646 | + logger, logger_str = OctocatalogDiff::Spec.setup_logger |
| 1647 | + opts = { use_lcs: true, logger: logger } |
| 1648 | + testobj = OctocatalogDiff::CatalogDiff::Differ.new(opts, @c1, @c2) |
| 1649 | + testobj.diff |
| 1650 | + expect(logger_str.string).to match(/Entering hashdiff_initial; catalog sizes: 1, 1/) |
| 1651 | + expect(logger_str.string).to match(/HashDiff configuration: \(use_lcs: true\)/) |
| 1652 | + end |
| 1653 | + |
| 1654 | + it 'the default value is true' do |
| 1655 | + logger, logger_str = OctocatalogDiff::Spec.setup_logger |
| 1656 | + opts = { logger: logger } |
| 1657 | + testobj = OctocatalogDiff::CatalogDiff::Differ.new(opts, @c1, @c2) |
| 1658 | + testobj.diff |
| 1659 | + expect(logger_str.string).to match(/Entering hashdiff_initial; catalog sizes: 1, 1/) |
| 1660 | + expect(logger_str.string).to match(/HashDiff configuration: \(use_lcs: true\)/) |
| 1661 | + end |
| 1662 | + end |
| 1663 | + end |
1614 | 1664 | end
|
1615 | 1665 | end
|
0 commit comments