active-triples 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ require 'active_triples'
2
+
3
+ Dir['./spec/support/**/*.rb'].each { |f| require f }
@@ -0,0 +1,81 @@
1
+ shared_examples_for "an ActiveModel" do
2
+ subject { described_class.new }
3
+
4
+ describe '#to_key' do
5
+ it 'should respond' do
6
+ expect(subject).to respond_to :to_key
7
+ end
8
+
9
+ it 'should return nil when #persisted? is false ' do
10
+ def subject.persisted?() false end
11
+ expect(subject.to_key).to eq nil
12
+ end
13
+ end
14
+
15
+ describe '#to_param' do
16
+ it 'should respond' do
17
+ expect(subject).to respond_to :to_param
18
+ end
19
+
20
+ it 'should return nil when #persisted? is false ' do
21
+ def subject.persisted?() false end
22
+ expect(subject.to_param).to eq nil
23
+ end
24
+ end
25
+
26
+ describe '#model_name' do
27
+ let(:model_name) { subject.class.model_name }
28
+
29
+ it 'should have a model name' do
30
+ expect(model_name).to respond_to :to_str
31
+ end
32
+
33
+ it 'should have a human name' do
34
+ expect(model_name.human).to respond_to :to_str
35
+ end
36
+
37
+ it 'should have a singular name' do
38
+ expect(model_name.singular).to respond_to :to_str
39
+ end
40
+
41
+ it 'should have a plural name' do
42
+ expect(model_name.plural).to respond_to :to_str
43
+ end
44
+ end
45
+
46
+ describe '#to_partial_path' do
47
+ it 'should return a string' do
48
+ expect(subject.to_partial_path).to be_a String
49
+ end
50
+ end
51
+
52
+ describe '#persisted?' do
53
+ it 'should return a boolean' do
54
+ expect(match_boolean(subject.persisted?)).to be_true
55
+ end
56
+ end
57
+
58
+ describe '#valid?' do
59
+ it 'should return a boolean' do
60
+ expect(match_boolean(subject.valid?)).to be_true
61
+ end
62
+ end
63
+
64
+ describe '#new_record' do
65
+ it 'should return a boolean' do
66
+ expect(match_boolean(subject.new_record?)).to be_true
67
+ end
68
+ end
69
+
70
+ describe '#destroyed?' do
71
+ it 'should return a boolean' do
72
+ expect(match_boolean(subject.destroyed?)).to be_true
73
+ end
74
+ end
75
+
76
+ private
77
+
78
+ def match_boolean(result)
79
+ result == true || result == false
80
+ end
81
+ end
metadata ADDED
@@ -0,0 +1,197 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: active-triples
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Tom Johnson
8
+ - Trey Terrell
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-04-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rdf
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.1'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.1'
28
+ - !ruby/object:Gem::Dependency
29
+ name: linkeddata
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.1'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.1'
42
+ - !ruby/object:Gem::Dependency
43
+ name: activemodel
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :runtime
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: deprecation
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.1'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '0.1'
70
+ - !ruby/object:Gem::Dependency
71
+ name: activesupport
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :runtime
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
85
+ name: rdoc
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ type: :development
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
99
+ name: rspec
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ type: :development
106
+ prerelease: false
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: webmock
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
119
+ type: :development
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
127
+ name: nokogiri
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ type: :development
134
+ prerelease: false
135
+ version_requirements: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ description: ActiveTriples provides tools for modeling RDF as discrete resources.
141
+ email: thomas.johnson@oregonstate.edu
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files:
145
+ - LICENSE
146
+ - README.md
147
+ files:
148
+ - ".gitignore"
149
+ - ".travis.yml"
150
+ - AUTHORS
151
+ - Gemfile
152
+ - LICENSE
153
+ - README.md
154
+ - active-triples.gemspec
155
+ - lib/active_triples.rb
156
+ - lib/active_triples/configurable.rb
157
+ - lib/active_triples/indexing.rb
158
+ - lib/active_triples/list.rb
159
+ - lib/active_triples/nested_attributes.rb
160
+ - lib/active_triples/node_config.rb
161
+ - lib/active_triples/properties.rb
162
+ - lib/active_triples/repositories.rb
163
+ - lib/active_triples/resource.rb
164
+ - lib/active_triples/term.rb
165
+ - lib/active_triples/version.rb
166
+ - spec/rdf_list_spec.rb
167
+ - spec/rdf_nested_attributes_spec.rb
168
+ - spec/rdf_properties_spec.rb
169
+ - spec/rdf_repositories_spec.rb
170
+ - spec/rdf_resource_spec.rb
171
+ - spec/spec_helper.rb
172
+ - spec/support/active_model_lint.rb
173
+ homepage: https://github.com/no-reply/ActiveTriples
174
+ licenses:
175
+ - Public Domain
176
+ metadata: {}
177
+ post_install_message:
178
+ rdoc_options: []
179
+ require_paths:
180
+ - lib
181
+ required_ruby_version: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ version: 1.9.3
186
+ required_rubygems_version: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - ">="
189
+ - !ruby/object:Gem::Version
190
+ version: '0'
191
+ requirements: []
192
+ rubyforge_project:
193
+ rubygems_version: 2.2.1
194
+ signing_key:
195
+ specification_version: 4
196
+ summary: RDF graphs in ActiveModel wrappers.
197
+ test_files: []