Sha256: 107fc4817a448e2eef03ab66f2a10df77b996ccfa0414fbbcc1743e2ad3cde44

Contents?: true

Size: 1.04 KB

Versions: 15

Compression:

Stored size: 1.04 KB

Contents

require 'test_helper'

module ExCite
  class RecordTest < ActiveSupport::TestCase

    test "typeones fields should be records fields" do
      assert_equal "formatting", TypeOne.format_field
    end

    test "test a typetwos fields should be records fields" do
      assert_equal "from_format", TypeTwo.format_field
    end

    test "test typeones formatting should populate records fields" do
      typeone = TypeOne.new(:formatting => "csf", :raw => "itemType: book")
      assert_equal "csf", typeone.formatting
    end

    test "test typetwos formatting should populate records fields" do
      typetwo = TypeTwo.new(:from_format => "csf", :data => "itemType: book")
      assert_equal "csf", typetwo.from_format
    end
    
    test "test typeones ability to act as citable" do
      ExCite.acts_as_citable_class = "TypeOne"
      t = ExCite.acts_as_citable_class.new(:formatting => "csf", :raw => "itemType: book")
      t.id = 1
      assert_equal t.to_ris, "TY  - BOOK\nER  -\n\n"
      ExCite.acts_as_citable_class = "ExCite::Citation"
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
ex_cite-2.0.0.pre.alpha.1 test/unit/ex_cite/citation_test.rb
ex_cite-2.0.0.pre.alpha test/unit/ex_cite/citation_test.rb
ex_cite-1.3.2 test/unit/ex_cite/citation_test.rb
ex_cite-1.3.1 test/unit/ex_cite/citation_test.rb
ex_cite-1.3.0 test/unit/ex_cite/citation_test.rb
ex_cite-1.2.7 test/unit/ex_cite/citation_test.rb
ex_cite-1.2.6 test/unit/ex_cite/citation_test.rb
ex_cite-1.2.5 test/unit/ex_cite/citation_test.rb
ex_cite-1.2.4 test/unit/ex_cite/citation_test.rb
ex_cite-1.2.3 test/unit/ex_cite/citation_test.rb
ex_cite-1.2.2 test/unit/ex_cite/citation_test.rb
ex_cite-1.2.1 test/unit/ex_cite/citation_test.rb
ex_cite-1.1.0 test/unit/ex_cite/citation_test.rb
ex_cite-1.0.1 test/unit/ex_cite/citation_test.rb
ex_cite-1.0.0 test/unit/ex_cite/citation_test.rb