test/unit/report/test_base.rb in thinreports-0.8.1 vs test/unit/report/test_base.rb in thinreports-0.8.2

- old
+ new

@@ -122,23 +122,23 @@ report = Report::Base.new layout: data_file('layout_text1.tlf') report.generate :pdf, filename: temp_path.join('result1.pdf') report.generate filename: temp_path.join('result2.pdf') - assert File.exists?(temp_path.join('result1.pdf')) - assert File.exists?(temp_path.join('result2.pdf')) + assert File.exist?(temp_path.join('result1.pdf')) + assert File.exist?(temp_path.join('result2.pdf')) assert_equal File.read(temp_path.join('result1.pdf')), File.read(temp_path.join('result2.pdf')) end def test_events_should_return_Report_Events assert_instance_of Thinreports::Report::Events, @report.events end def test_events_should_deprecated - out, err = capture_io do + _out, err = capture_io do @report.events end assert_includes err, '[DEPRECATION]' end @@ -230,44 +230,44 @@ Report::Base.generate(:pdf) end end def test_Base_extract_options_should_return_as_report_option_the_value_which_has_report_in_a_key - report, generator = Report::Base.send(:extract_options!, [{report: {layout: 'hoge.tlf'}}]) + report, _generator = Report::Base.send(:extract_options!, [{report: {layout: 'hoge.tlf'}}]) assert_equal report[:layout], 'hoge.tlf' end def test_Base_extract_options_should_operate_an_argument_destructively args = [:pdf, 'output.pdf', {report: {layout: 'foo.tlf'}}] Report::Base.send(:extract_options!, args) assert_equal args, [:pdf, 'output.pdf'] end def test_Base_extract_options_should_include_the_layout_key_in_the_report_option - report, generator = Report::Base.send(:extract_options!, [{layout: 'hoge.tlf'}]) + report, _generator = Report::Base.send(:extract_options!, [{layout: 'hoge.tlf'}]) assert_equal report[:layout], 'hoge.tlf' end def test_Base_extract_options_should_give_priority_to_the_value_of_the_layout_key_over_in_the_report_option - report, generator = Report::Base.send(:extract_options!, + report, _generator = Report::Base.send(:extract_options!, [{report: {layout: 'foo.tlf'}, layout: 'hoge.tlf'}]) assert_equal report[:layout], 'hoge.tlf' end def test_Base_extract_options_should_return_as_generator_option_the_value_which_has_generator_in_a_key - report, generator = Report::Base.send(:extract_options!, + _report, generator = Report::Base.send(:extract_options!, [{generator: {option: 'value'}}]) assert_equal generator[:option], 'value' end def test_Base_extract_options_should_give_priority_to_the_value_of_other_keys_over_in_the_generator_option - report, generator = Report::Base.send(:extract_options!, + _report, generator = Report::Base.send(:extract_options!, [{generator: {option: 'value1'}, option: 'value2'}]) assert_equal generator[:option], 'value2' end def test_Base_extract_options_should_return_all_the_values_except_the_report_option_as_a_generator_option - report, generator = Report::Base.send(:extract_options!, + _report, generator = Report::Base.send(:extract_options!, [{report: {layout: 'foo.tlf'}, layout: 'hoge.tlf', generator_opt1: 'value1', generator_opt2: 'value2'}]) assert_equal generator.values_at(:generator_opt1, :generator_opt2), ['value1', 'value2'] end