Class: FCBTest
Instance Method Summary collapse
- #setup ⇒ Object
- #test_initialization_with_correct_data ⇒ Object
- #test_method_missing_getter ⇒ Object
- #test_method_missing_setter ⇒ Object
- #test_to_h_method ⇒ Object
- #test_to_yaml_method ⇒ Object
Instance Method Details
#setup ⇒ Object
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 |
# File 'lib/fcb.rb', line 532 def setup @fcb_data = { block: nil, body: 'Sample body', call: 'Sample call', dname: 'Sample name', headings: %w[Header1 Header2], indent: '', name: 'Sample name', nickname: nil, oname: 'Sample name', reqs: %w[req1 req2], shell: ShellType::BASH, start_line: nil, text: 'Sample Text', title: 'Sample Title', type: 'shell' } @fcb = MarkdownExec::FCB.new(@fcb_data) end |
#test_initialization_with_correct_data ⇒ Object
553 554 555 556 |
# File 'lib/fcb.rb', line 553 def test_initialization_with_correct_data assert_equal 'Sample body', @fcb.body assert_equal %w[Header1 Header2], @fcb.headings end |
#test_method_missing_getter ⇒ Object
570 571 572 |
# File 'lib/fcb.rb', line 570 def test_method_missing_getter assert_equal 'Sample Title', @fcb.title end |
#test_method_missing_setter ⇒ Object
574 575 576 577 |
# File 'lib/fcb.rb', line 574 def test_method_missing_setter @fcb.title = 'New Title' assert_equal 'New Title', @fcb.title end |
#test_to_h_method ⇒ Object
558 559 560 561 562 |
# File 'lib/fcb.rb', line 558 def test_to_h_method assert_equal_hash @fcb_data.merge( { id: @fcb.id, random: @fcb.random } ), @fcb.to_h end |
#test_to_yaml_method ⇒ Object
564 565 566 567 568 |
# File 'lib/fcb.rb', line 564 def test_to_yaml_method assert_equal_hash YAML.load(@fcb_data.merge( { id: @fcb.id, random: @fcb.random } ).to_yaml), YAML.load(@fcb.to_yaml) end |