sql_record 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sql_record/base.rb +1 -1
- data/spec/spec_helper.rb +3 -2
- data/spec/sql_record/base_spec.rb +21 -0
- data/spec/sql_record/sanitized_query_spec.rb +5 -0
- data/spec/sql_record_spec.rb +11 -2
- data/sql_record.gemspec +5 -1
- metadata +7 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.4
|
data/lib/sql_record/base.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
3
|
require 'rspec'
|
4
|
-
require '
|
4
|
+
require 'rspec-expectations'
|
5
|
+
require 'sql_record'
|
5
6
|
|
6
7
|
# Requires supporting files with custom matchers and macros, etc,
|
7
8
|
# in ./support/ and its subdirectories.
|
8
9
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
9
10
|
|
10
11
|
RSpec.configure do |config|
|
11
|
-
|
12
|
+
config.mock_framework = :rspec
|
12
13
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '../../spec_helper')
|
2
|
+
|
3
|
+
describe SQLRecord::Base do
|
4
|
+
|
5
|
+
describe "created" do
|
6
|
+
it { should respond_to(:raw_attributes) }
|
7
|
+
it { should_not respond_to(:raw_attributes=)}
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
describe "initialized without an attributes hash" do
|
12
|
+
its("raw_attributes") { should == {} }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "initialized with a raw_attributes" do
|
16
|
+
subject { SQLRecord::Base.new 'a'=>'my_record' }
|
17
|
+
its("raw_attributes") { should == {'a' => 'my_record'} }
|
18
|
+
end
|
19
|
+
|
20
|
+
|
21
|
+
end
|
data/spec/sql_record_spec.rb
CHANGED
@@ -1,7 +1,16 @@
|
|
1
1
|
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
2
|
|
3
3
|
describe "SQLRecord" do
|
4
|
-
it "
|
5
|
-
|
4
|
+
it "should define Base" do
|
5
|
+
defined?(SQLRecord::Base).should be_true
|
6
6
|
end
|
7
|
+
|
8
|
+
it "should define Attributes::Mapper" do
|
9
|
+
defined?(SQLRecord::Attributes::Mapper).should be_true
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should define SanitizedQuery" do
|
13
|
+
defined?(SQLRecord::SanitizedQuery).should be_true
|
14
|
+
end
|
15
|
+
|
7
16
|
end
|
data/sql_record.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{sql_record}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Rasheed Abdul-Aziz"]
|
@@ -31,6 +31,8 @@ Gem::Specification.new do |s|
|
|
31
31
|
"lib/sql_record/base.rb",
|
32
32
|
"lib/sql_record/sanitized_query.rb",
|
33
33
|
"spec/spec_helper.rb",
|
34
|
+
"spec/sql_record/base_spec.rb",
|
35
|
+
"spec/sql_record/sanitized_query_spec.rb",
|
34
36
|
"spec/sql_record_spec.rb",
|
35
37
|
"sql_record.gemspec"
|
36
38
|
]
|
@@ -41,6 +43,8 @@ Gem::Specification.new do |s|
|
|
41
43
|
s.summary = %q{SQL direct mapping to ActiveRecord}
|
42
44
|
s.test_files = [
|
43
45
|
"spec/spec_helper.rb",
|
46
|
+
"spec/sql_record/base_spec.rb",
|
47
|
+
"spec/sql_record/sanitized_query_spec.rb",
|
44
48
|
"spec/sql_record_spec.rb"
|
45
49
|
]
|
46
50
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sql_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 4
|
10
|
+
version: 1.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Rasheed Abdul-Aziz
|
@@ -134,6 +134,8 @@ files:
|
|
134
134
|
- lib/sql_record/base.rb
|
135
135
|
- lib/sql_record/sanitized_query.rb
|
136
136
|
- spec/spec_helper.rb
|
137
|
+
- spec/sql_record/base_spec.rb
|
138
|
+
- spec/sql_record/sanitized_query_spec.rb
|
137
139
|
- spec/sql_record_spec.rb
|
138
140
|
- sql_record.gemspec
|
139
141
|
has_rdoc: true
|
@@ -172,4 +174,6 @@ specification_version: 3
|
|
172
174
|
summary: SQL direct mapping to ActiveRecord
|
173
175
|
test_files:
|
174
176
|
- spec/spec_helper.rb
|
177
|
+
- spec/sql_record/base_spec.rb
|
178
|
+
- spec/sql_record/sanitized_query_spec.rb
|
175
179
|
- spec/sql_record_spec.rb
|