large_text_field 0.3.2 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/db/migrate/20110217210640_add_large_text_fields.rb +1 -2
- data/lib/large_text_field/named_text_value.rb +0 -4
- data/lib/large_text_field/owner.rb +2 -2
- data/lib/large_text_field/version.rb +1 -1
- data/lib/large_text_field.rb +0 -2
- data/test/dummy/app/models/library.rb +0 -1
- data/test/dummy/config/database.yml +13 -1
- data/test/dummy/config/environments/development.rb +0 -3
- data/test/dummy/config/environments/test.rb +0 -3
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +10 -9
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +32 -12
- data/test/dummy/log/test.log +1261 -439
- data/test/reports/TEST-LargeTextField-LibraryTest.xml +3 -3
- data/test/reports/TEST-LargeTextField-NamedTextValueTest.xml +6 -6
- data/test/reports/TEST-LargeTextField-OwnerTest.xml +26 -24
- data/test/reports/TEST-LargeTextFieldTest.xml +2 -2
- data/test/test_helper.rb +3 -1
- data/test/unit/large_text_field/owner_test.rb +4 -0
- metadata +13 -21
@@ -1,9 +1,9 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<testsuites>
|
3
|
-
<testsuite name="LargeTextField::LibraryTest" filepath="/Users/
|
4
|
-
<testcase name="test_: LargeTextField::Library should be able to construct a library. " lineno="7" classname="LargeTextField::LibraryTest" assertions="2" time="0.
|
3
|
+
<testsuite name="LargeTextField::LibraryTest" filepath="/Users/tstarck/invoca/large_text_field/test/unit/dummy/library_test.rb" skipped="0" failures="0" errors="0" tests="2" assertions="2" time="0.00797699997201562">
|
4
|
+
<testcase name="test_: LargeTextField::Library should be able to construct a library. " lineno="7" classname="LargeTextField::LibraryTest" assertions="2" time="0.005172000033780932">
|
5
5
|
</testcase>
|
6
|
-
<testcase name="test_: LargeTextField::Library should be able to dup a class that has no current large text field. " lineno="20" classname="LargeTextField::LibraryTest" assertions="0" time="0.
|
6
|
+
<testcase name="test_: LargeTextField::Library should be able to dup a class that has no current large text field. " lineno="20" classname="LargeTextField::LibraryTest" assertions="0" time="0.002804999938234687">
|
7
7
|
</testcase>
|
8
8
|
</testsuite>
|
9
9
|
</testsuites>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<testsuites>
|
3
|
-
<testsuite name="LargeTextField::NamedTextValueTest" filepath="/Users/
|
4
|
-
<testcase name="test_: LargeTextField::NamedTextValue should belong to owner. " lineno="346" classname="LargeTextField::NamedTextValueTest" assertions="1" time="0.
|
3
|
+
<testsuite name="LargeTextField::NamedTextValueTest" filepath="/Users/tstarck/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/shoulda-context-1.2.2/lib/shoulda/context/context.rb" skipped="0" failures="0" errors="0" tests="5" assertions="9" time="0.06121000007260591">
|
4
|
+
<testcase name="test_: LargeTextField::NamedTextValue should belong to owner. " lineno="346" classname="LargeTextField::NamedTextValueTest" assertions="1" time="0.003751999931409955">
|
5
5
|
</testcase>
|
6
|
-
<testcase name="test_: LargeTextField::NamedTextValue should have field name and value attributes. " lineno="11" classname="LargeTextField::NamedTextValueTest" assertions="6" time="0.
|
6
|
+
<testcase name="test_: LargeTextField::NamedTextValue should have field name and value attributes. " lineno="11" classname="LargeTextField::NamedTextValueTest" assertions="6" time="0.0427560000680387">
|
7
7
|
</testcase>
|
8
|
-
<testcase name="test_: LargeTextField::NamedTextValue should use large_text_fields as the table name. " lineno="7" classname="LargeTextField::NamedTextValueTest" assertions="1" time="0.
|
8
|
+
<testcase name="test_: LargeTextField::NamedTextValue should use large_text_fields as the table name. " lineno="7" classname="LargeTextField::NamedTextValueTest" assertions="1" time="0.0005510000046342611">
|
9
9
|
</testcase>
|
10
|
-
<testcase name="test_: unique index should allow different owners and field names. " lineno="36" classname="LargeTextField::NamedTextValueTest" assertions="0" time="0.
|
10
|
+
<testcase name="test_: unique index should allow different owners and field names. " lineno="36" classname="LargeTextField::NamedTextValueTest" assertions="0" time="0.009568999987095594">
|
11
11
|
</testcase>
|
12
|
-
<testcase name="test_: unique index should raise a unique constraint failure on the same owner, and field name. " lineno="27" classname="LargeTextField::NamedTextValueTest" assertions="1" time="0.
|
12
|
+
<testcase name="test_: unique index should raise a unique constraint failure on the same owner, and field name. " lineno="27" classname="LargeTextField::NamedTextValueTest" assertions="1" time="0.004582000081427395">
|
13
13
|
</testcase>
|
14
14
|
</testsuite>
|
15
15
|
</testsuites>
|
@@ -1,51 +1,53 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<testsuites>
|
3
|
-
<testsuite name="LargeTextField::OwnerTest" filepath="/Users/
|
4
|
-
<testcase name="test_: a large text field should allow a custom maximum length to be provided. " lineno="135" classname="LargeTextField::OwnerTest" assertions="3" time="0.
|
3
|
+
<testsuite name="LargeTextField::OwnerTest" filepath="/Users/tstarck/invoca/large_text_field/test/unit/large_text_field/owner_test.rb" skipped="0" failures="0" errors="0" tests="24" assertions="99" time="0.18328300002031028">
|
4
|
+
<testcase name="test_: a large text field should allow a custom maximum length to be provided. " lineno="135" classname="LargeTextField::OwnerTest" assertions="3" time="0.013416999951004982">
|
5
5
|
</testcase>
|
6
|
-
<testcase name="test_: a large text field should allow
|
6
|
+
<testcase name="test_: a large text field should allow a single argument to be passed into reload. " lineno="301" classname="LargeTextField::OwnerTest" assertions="1" time="0.004912999924272299">
|
7
7
|
</testcase>
|
8
|
-
<testcase name="test_: a large text field should allow
|
8
|
+
<testcase name="test_: a large text field should allow for concurrent sets and deletes. " lineno="84" classname="LargeTextField::OwnerTest" assertions="9" time="0.007678000023588538">
|
9
9
|
</testcase>
|
10
|
-
<testcase name="test_: a large text field should
|
10
|
+
<testcase name="test_: a large text field should allow get and set with saves and deletes. " lineno="61" classname="LargeTextField::OwnerTest" assertions="7" time="0.014948999974876642">
|
11
11
|
</testcase>
|
12
|
-
<testcase name="test_: a large text field should be able to
|
12
|
+
<testcase name="test_: a large text field should be able to be eager loaded. " lineno="244" classname="LargeTextField::OwnerTest" assertions="3" time="0.01591099996585399">
|
13
13
|
</testcase>
|
14
|
-
<testcase name="test_: a large text field should be
|
14
|
+
<testcase name="test_: a large text field should be able to update deleted fields. " lineno="194" classname="LargeTextField::OwnerTest" assertions="7" time="0.008474000031128526">
|
15
15
|
</testcase>
|
16
|
-
<testcase name="test_: a large text field should
|
16
|
+
<testcase name="test_: a large text field should be cloned with the rest of the record. " lineno="218" classname="LargeTextField::OwnerTest" assertions="9" time="0.023695999989286065">
|
17
17
|
</testcase>
|
18
|
-
<testcase name="test_: a large text field should
|
18
|
+
<testcase name="test_: a large text field should declare the association when it is first described and other meta data when it is first defined. " lineno="35" classname="LargeTextField::OwnerTest" assertions="3" time="0.0033099999418482184">
|
19
19
|
</testcase>
|
20
|
-
<testcase name="test_: a large text field should delete
|
20
|
+
<testcase name="test_: a large text field should delete fields when they are set to blank. " lineno="173" classname="LargeTextField::OwnerTest" assertions="6" time="0.009033999987877905">
|
21
21
|
</testcase>
|
22
|
-
<testcase name="test_: a large text field should
|
22
|
+
<testcase name="test_: a large text field should delete large text fields when the owner is destroyed. " lineno="305" classname="LargeTextField::OwnerTest" assertions="4" time="0.006717000040225685">
|
23
23
|
</testcase>
|
24
|
-
<testcase name="test_: a large text field should
|
24
|
+
<testcase name="test_: a large text field should detect changes when @text_field_hash hash is/not empty. " lineno="268" classname="LargeTextField::OwnerTest" assertions="7" time="0.005818000063300133">
|
25
25
|
</testcase>
|
26
|
-
<testcase name="test_: a large text field should
|
26
|
+
<testcase name="test_: a large text field should forget about changes if they are not saved. " lineno="109" classname="LargeTextField::OwnerTest" assertions="3" time="0.006125000072643161">
|
27
27
|
</testcase>
|
28
|
-
<testcase name="test_: a large text field should
|
28
|
+
<testcase name="test_: a large text field should not save fields that are set to blank. " lineno="157" classname="LargeTextField::OwnerTest" assertions="5" time="0.007122000097297132">
|
29
29
|
</testcase>
|
30
|
-
<testcase name="test_: a large text field should
|
30
|
+
<testcase name="test_: a large text field should only validate_large_text_fields if loaded. " lineno="285" classname="LargeTextField::OwnerTest" assertions="4" time="0.00335600005928427">
|
31
31
|
</testcase>
|
32
|
-
<testcase name="test_: a large text field should prevent a
|
32
|
+
<testcase name="test_: a large text field should prevent a custom maximum length to be provided that is not in the allowable range. " lineno="147" classname="LargeTextField::OwnerTest" assertions="3" time="0.0030239999759942293">
|
33
33
|
</testcase>
|
34
|
-
<testcase name="test_: a large text field should
|
34
|
+
<testcase name="test_: a large text field should prevent a non-Integer to be provided for a custom maximum. " lineno="141" classname="LargeTextField::OwnerTest" assertions="2" time="0.00317799998447299">
|
35
35
|
</testcase>
|
36
|
-
<testcase name="test_: a large text field should
|
36
|
+
<testcase name="test_: a large text field should read from a file. " lineno="41" classname="LargeTextField::OwnerTest" assertions="3" time="0.01081999996677041">
|
37
37
|
</testcase>
|
38
|
-
<testcase name="test_: a large text field should
|
38
|
+
<testcase name="test_: a large text field should reload changes when they come from a different model. " lineno="292" classname="LargeTextField::OwnerTest" assertions="2" time="0.007147000054828823">
|
39
39
|
</testcase>
|
40
|
-
<testcase name="test_: a large text field should
|
40
|
+
<testcase name="test_: a large text field should singularize the errors if requested. " lineno="129" classname="LargeTextField::OwnerTest" assertions="3" time="0.00828499998897314">
|
41
41
|
</testcase>
|
42
|
-
<testcase name="test_: a large text field should
|
42
|
+
<testcase name="test_: a large text field should support strings or symbols for get/set methods. " lineno="256" classname="LargeTextField::OwnerTest" assertions="7" time="0.002863000030629337">
|
43
43
|
</testcase>
|
44
|
-
<testcase name="test_:
|
44
|
+
<testcase name="test_: a large text field should validate the maximum length. " lineno="123" classname="LargeTextField::OwnerTest" assertions="3" time="0.007084999931976199">
|
45
45
|
</testcase>
|
46
|
-
<testcase name="test_: updating in large_text_field_save hook should be able to assign
|
46
|
+
<testcase name="test_: updating in large_text_field_save hook should be able to assign empty string. " lineno="9" classname="LargeTextField::OwnerTest" assertions="2" time="0.004567999974824488">
|
47
47
|
</testcase>
|
48
|
-
<testcase name="test_: updating in large_text_field_save hook should
|
48
|
+
<testcase name="test_: updating in large_text_field_save hook should be able to assign non empty string. " lineno="9" classname="LargeTextField::OwnerTest" assertions="2" time="0.004910999909043312">
|
49
|
+
</testcase>
|
50
|
+
<testcase name="test_: updating in large_text_field_save hook should raise error on saving nil value. " lineno="19" classname="LargeTextField::OwnerTest" assertions="1" time="0.0008820000803098083">
|
49
51
|
</testcase>
|
50
52
|
</testsuite>
|
51
53
|
</testsuites>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<testsuites>
|
3
|
-
<testsuite name="LargeTextFieldTest" filepath="/Users/
|
4
|
-
<testcase name="test_truth" lineno="6" classname="LargeTextFieldTest" assertions="1" time="0.
|
3
|
+
<testsuite name="LargeTextFieldTest" filepath="/Users/tstarck/invoca/large_text_field/test/large_text_field_test.rb" skipped="0" failures="0" errors="0" tests="1" assertions="1" time="0.00063699996098876">
|
4
|
+
<testcase name="test_truth" lineno="6" classname="LargeTextFieldTest" assertions="1" time="0.00063699996098876">
|
5
5
|
</testcase>
|
6
6
|
</testsuite>
|
7
7
|
</testsuites>
|
data/test/test_helper.rb
CHANGED
@@ -8,9 +8,11 @@ require "rr"
|
|
8
8
|
require "shoulda"
|
9
9
|
require "minitest/unit"
|
10
10
|
require 'minitest/reporters'
|
11
|
+
|
12
|
+
junit_output_dir = ENV['JUNIT_OUTPUT'].presence || "test/reports"
|
11
13
|
Minitest::Reporters.use! [
|
12
14
|
Minitest::Reporters::DefaultReporter.new,
|
13
|
-
Minitest::Reporters::JUnitReporter.new
|
15
|
+
Minitest::Reporters::JUnitReporter.new(junit_output_dir)
|
14
16
|
]
|
15
17
|
|
16
18
|
require "pry"
|
@@ -298,6 +298,10 @@ module LargeTextField
|
|
298
298
|
assert_equal "The main research library of the University of Cambridge in England", @library.reload.description
|
299
299
|
end
|
300
300
|
|
301
|
+
should "allow a single argument to be passed into reload" do
|
302
|
+
Library.create!(name: "Cambridge University Library", description: "in england").reload(lock: true)
|
303
|
+
end
|
304
|
+
|
301
305
|
should "delete large text fields when the owner is destroyed" do
|
302
306
|
assert_equal 0, LargeTextField::NamedTextValue.count
|
303
307
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: large_text_field
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Invoca
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: invoca-utils
|
@@ -24,34 +24,26 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0.3'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: protected_attributes
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.1'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.1'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rails
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
|
-
- - "
|
31
|
+
- - ">="
|
46
32
|
- !ruby/object:Gem::Version
|
47
33
|
version: '4.2'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '7'
|
48
37
|
type: :runtime
|
49
38
|
prerelease: false
|
50
39
|
version_requirements: !ruby/object:Gem::Requirement
|
51
40
|
requirements:
|
52
|
-
- - "
|
41
|
+
- - ">="
|
53
42
|
- !ruby/object:Gem::Version
|
54
43
|
version: '4.2'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '7'
|
55
47
|
description: Large text fields are kept in a central table, and polymorphically associated
|
56
48
|
with your models. Access and assignment should behave as if it was a column on
|
57
49
|
the same table.
|
@@ -104,7 +96,7 @@ homepage: http://github.com/invoca
|
|
104
96
|
licenses: []
|
105
97
|
metadata:
|
106
98
|
allowed_push_host: https://rubygems.org
|
107
|
-
post_install_message:
|
99
|
+
post_install_message:
|
108
100
|
rdoc_options: []
|
109
101
|
require_paths:
|
110
102
|
- lib
|
@@ -120,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
112
|
version: '0'
|
121
113
|
requirements: []
|
122
114
|
rubygems_version: 3.0.1
|
123
|
-
signing_key:
|
115
|
+
signing_key:
|
124
116
|
specification_version: 4
|
125
117
|
summary: Add large text fields to models without database migrations
|
126
118
|
test_files:
|