jamjar 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +22 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +2 -5
- data/README.md +12 -0
- data/gemfiles/activerecord_3.2.gemfile +1 -1
- data/gemfiles/activerecord_4.0.gemfile +1 -1
- data/gemfiles/activerecord_4.1.gemfile +1 -1
- data/gemfiles/activerecord_4.2.gemfile +1 -1
- data/lib/jamjar/model.rb +4 -4
- data/lib/jamjar/version.rb +1 -1
- data/spec/jamjar_spec.rb +7 -1
- data/spec/spec_helper.rb +0 -19
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3dd3a28f20600cc2092fc0b242a140ab64db0f0e
|
4
|
+
data.tar.gz: 987d3e3a0c25528a0ec63ee0959658b9546aaccd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 733276e5d6f7f0942b54f086bf79563286b9a94d303840c140153bcb0dcc77bf8f432fbf5203781f6fa9f17ac9e062b09a3a18a26fc42c58f1d428831f2ff8f2
|
7
|
+
data.tar.gz: d7c03a66ad5a075e76cdca69f416005a508d9c0b1b64fd7ddcece516f3b1dc174739333a9fae93f8490066f68b21006cffceeb8fdd84039cf6447de44985bb92
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.1
|
1
|
+
ruby-2.2.1
|
data/.travis.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
language: ruby
|
2
|
+
|
3
|
+
env:
|
4
|
+
global:
|
5
|
+
- TRAVIS_CI=1
|
6
|
+
|
7
|
+
rvm:
|
8
|
+
- 1.9.3
|
9
|
+
- 2.0.0
|
10
|
+
- 2.1.5
|
11
|
+
- 2.2.1
|
12
|
+
|
13
|
+
gemfile:
|
14
|
+
- gemfiles/activerecord_3.2.gemfile
|
15
|
+
- gemfiles/activerecord_4.0.gemfile
|
16
|
+
- gemfiles/activerecord_4.1.gemfile
|
17
|
+
- gemfiles/activerecord_4.2.gemfile
|
18
|
+
|
19
|
+
before_install: gem update bundler
|
20
|
+
bundler_args: --without tools
|
21
|
+
|
22
|
+
script: bundle exec rspec -b
|
data/CHANGELOG.md
ADDED
data/Gemfile
CHANGED
@@ -11,10 +11,7 @@ gem "rspec"
|
|
11
11
|
gem "rspec-expect_it"
|
12
12
|
gem "fuubar"
|
13
13
|
|
14
|
-
# gem "simplecov", require: false
|
15
|
-
# gem "coveralls", require: false
|
16
|
-
|
17
14
|
group :tools do
|
18
|
-
gem "byebug", platform: [:ruby_20, :ruby_21]
|
15
|
+
gem "byebug", platform: [:ruby_20, :ruby_21, :ruby_22]
|
19
16
|
gem "debugger", platform: :ruby_19
|
20
|
-
end
|
17
|
+
end
|
data/README.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
[![Gem Version](https://img.shields.io/gem/v/jamjar.svg?style=flat-square)](http://rubygems.org/gems/jamjar)
|
2
|
+
[![Build Status](https://img.shields.io/travis/thomasfedb/jamjar.svg?style=flat-square)](https://travis-ci.org/thomasfedb/jamjar)
|
3
|
+
[![Code Climate](https://img.shields.io/codeclimate/github/thomasfedb/jamjar.svg?style=flat-square)](https://codeclimate.com/github/thomasfedb/jamjar)
|
4
|
+
|
1
5
|
# JamJar
|
2
6
|
|
3
7
|
JamJar dynamically creates ActiveRecord models, backed by in-memory SQLite, to help you test your ActiveRecord extensions.
|
@@ -42,6 +46,14 @@ JamJar.model do
|
|
42
46
|
end
|
43
47
|
```
|
44
48
|
|
49
|
+
You can pass any options for your column that are supported by Rails, as described in the [Rails API Documentation](http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/TableDefinition.html#method-i-column).
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
JamJar.model do
|
53
|
+
column :foo, :string, default: "bar"
|
54
|
+
end
|
55
|
+
```
|
56
|
+
|
45
57
|
## Contributing
|
46
58
|
|
47
59
|
1. Fork it
|
data/lib/jamjar/model.rb
CHANGED
@@ -3,13 +3,13 @@ require "active_record"
|
|
3
3
|
module JamJar
|
4
4
|
class Model < ActiveRecord::Base
|
5
5
|
self.abstract_class = true
|
6
|
-
|
6
|
+
|
7
7
|
def self.name
|
8
8
|
"TestModel"
|
9
9
|
end
|
10
10
|
|
11
|
-
def self.column(name, type)
|
12
|
-
self.connection.add_column(self.table_name, name, type)
|
11
|
+
def self.column(name, type, options = {})
|
12
|
+
self.connection.add_column(self.table_name, name, type, options)
|
13
13
|
end
|
14
14
|
end
|
15
|
-
end
|
15
|
+
end
|
data/lib/jamjar/version.rb
CHANGED
data/spec/jamjar_spec.rb
CHANGED
@@ -17,6 +17,12 @@ RSpec.describe JamJar do
|
|
17
17
|
subject { JamJar.model { column :foo, :string } }
|
18
18
|
|
19
19
|
specify { expect(subject.new).to respond_to(:foo) }
|
20
|
+
|
21
|
+
context "with options" do
|
22
|
+
subject { JamJar.model { column :foo, :string, default: "bar" } }
|
23
|
+
|
24
|
+
specify { expect(subject.new.foo).to eq "bar" }
|
25
|
+
end
|
20
26
|
end
|
21
27
|
end
|
22
|
-
end
|
28
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -8,31 +8,12 @@ unless ENV["TRAVIS_CI"]
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
# if ENV["TRAVIS_CI"]
|
12
|
-
# require "simplecov"
|
13
|
-
# require "coveralls"
|
14
|
-
|
15
|
-
# SimpleCov.formatter = Coveralls::SimpleCov::Formatter
|
16
|
-
|
17
|
-
# SimpleCov.start do
|
18
|
-
# add_filter "/spec/"
|
19
|
-
# end
|
20
|
-
# end
|
21
|
-
|
22
11
|
if ENV["TRAVIS_CI"]
|
23
12
|
Bundler.require
|
24
13
|
else
|
25
14
|
Bundler.require(:default, :tools)
|
26
15
|
end
|
27
16
|
|
28
|
-
# if defined?(Rails) && !Rails.respond_to?(:env)
|
29
|
-
# module Rails
|
30
|
-
# def self.env
|
31
|
-
# "default_env"
|
32
|
-
# end
|
33
|
-
# end
|
34
|
-
# end
|
35
|
-
|
36
17
|
Dir[File.expand_path("../support/**/*.rb", __FILE__)].each {|f| require f }
|
37
18
|
|
38
19
|
RSpec.configure do |config|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jamjar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Drake-Brockman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -49,7 +49,9 @@ files:
|
|
49
49
|
- ".gitignore"
|
50
50
|
- ".ruby-gemset"
|
51
51
|
- ".ruby-version"
|
52
|
+
- ".travis.yml"
|
52
53
|
- Appraisals
|
54
|
+
- CHANGELOG.md
|
53
55
|
- Gemfile
|
54
56
|
- LICENSE
|
55
57
|
- README.md
|
@@ -84,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
86
|
version: '0'
|
85
87
|
requirements: []
|
86
88
|
rubyforge_project:
|
87
|
-
rubygems_version: 2.4.
|
89
|
+
rubygems_version: 2.4.8
|
88
90
|
signing_key:
|
89
91
|
specification_version: 4
|
90
92
|
summary: JamJar generates ActiveRecord models for use in tests.
|