Sha256: b68b240c3fe670bee32fdd98167cb129b84e4c3b8b88cd5fbee7e12873fbdfc9

Contents?: true

Size: 956 Bytes

Versions: 18

Compression:

Stored size: 956 Bytes

Contents

require_relative "../spec_helper"

class ExportMethodsTest < Lanes::TestCase
    include TestingModels

    def test_simple_delegation

        refute TestModel.new.respond_to? :bt_description

        TestModel.send :delegate_and_export, "bt_description"

        md = TestModel.new
        assert md.respond_to? :bt_description, "Didn't add transaction_description method"
        assert_nil md.bt_description
        md.build_bt( description: "test123" )
        assert_equal "test123", md.bt_description

        assert TestModel.has_exported_method?( :bt_description, nil ), "Didn't export method"
    end

    def test_dependancy_calculation
        TestModel.send :delegate_and_export, "bt_description"
        TestModel.send :delegate_and_export, "bt_notes", optional: false
        assert_includes TestModel.exported_method_dependancies([]), :bt
        assert_includes TestModel.exported_method_dependancies(['bt_description']), :bt
    end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
lanes-0.8.3 spec/server/concerns/export_methods_spec.rb
lanes-0.8.2 spec/server/concerns/export_methods_spec.rb
lanes-0.8.1 spec/server/concerns/export_methods_spec.rb
lanes-0.8.0 spec/server/concerns/export_methods_spec.rb
lanes-0.7.0 spec/server/concerns/export_methods_spec.rb
lanes-0.6.1 spec/server/concerns/export_methods_spec.rb
lanes-0.6.0 spec/server/concerns/export_methods_spec.rb
lanes-0.5.6 spec/server/concerns/export_methods_spec.rb
lanes-0.5.5 spec/server/concerns/export_methods_spec.rb
lanes-0.5.0 spec/server/concerns/export_methods_spec.rb
lanes-0.4.0 spec/server/concerns/export_methods_spec.rb
lanes-0.3.0 spec/server/concerns/export_methods_spec.rb
lanes-0.1.9.5 spec/server/concerns/export_methods_spec.rb
lanes-0.1.9 spec/server/concerns/export_methods_spec.rb
lanes-0.1.8 spec/server/concerns/export_methods_spec.rb
lanes-0.1.7 spec/server/concerns/export_methods_spec.rb
lanes-0.1.6 spec/server/concerns/export_methods_spec.rb
lanes-0.1.5 spec/server/concerns/export_methods_spec.rb