jamjar 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ef21afc87146f39f051bb72e207ad489cbf25d1c
4
- data.tar.gz: 768fdd1c166fe6b3a21197c172fe6dc99a1000e5
3
+ metadata.gz: 3dd3a28f20600cc2092fc0b242a140ab64db0f0e
4
+ data.tar.gz: 987d3e3a0c25528a0ec63ee0959658b9546aaccd
5
5
  SHA512:
6
- metadata.gz: 1b1bb9b7567818c89d2835c24f85645dce48d47c2c9302166a3cdbc37b3342b9b08fb589f9046eb9cbcaa4c9b2017f69da5596019cc66dfdf2a1ebda982357c4
7
- data.tar.gz: 5d5d4222e1457ed12c3d7e2e711d7c539938b8901ec97269517924e231edcaa27292e6d29af6dd5aea0d5d1bf9ac55e5f57384d502e036c65b67da267580fdb8
6
+ metadata.gz: 733276e5d6f7f0942b54f086bf79563286b9a94d303840c140153bcb0dcc77bf8f432fbf5203781f6fa9f17ac9e062b09a3a18a26fc42c58f1d428831f2ff8f2
7
+ data.tar.gz: d7c03a66ad5a075e76cdca69f416005a508d9c0b1b64fd7ddcece516f3b1dc174739333a9fae93f8490066f68b21006cffceeb8fdd84039cf6447de44985bb92
@@ -1 +1 @@
1
- ruby-2.1.5
1
+ ruby-2.2.1
@@ -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
@@ -0,0 +1,11 @@
1
+ - 1.2.0
2
+ - Support passing options when creating columns on models.
3
+
4
+ - 1.1.0
5
+ - Compatibility with multiple ActiveRecord versions.
6
+
7
+ - 1.0.0
8
+ - Initial release.
9
+
10
+ - 0.0.1
11
+ - Reserved gem name.
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
@@ -11,7 +11,7 @@ gem "fuubar"
11
11
  gem "activerecord", "~> 3.2", :require => "active_record"
12
12
 
13
13
  group :tools do
14
- gem "byebug", :platform => [:ruby_20, :ruby_21]
14
+ gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
15
15
  gem "debugger", :platform => :ruby_19
16
16
  end
17
17
 
@@ -11,7 +11,7 @@ gem "fuubar"
11
11
  gem "activerecord", "~> 4.0", :require => "active_record"
12
12
 
13
13
  group :tools do
14
- gem "byebug", :platform => [:ruby_20, :ruby_21]
14
+ gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
15
15
  gem "debugger", :platform => :ruby_19
16
16
  end
17
17
 
@@ -11,7 +11,7 @@ gem "fuubar"
11
11
  gem "activerecord", "~> 4.1", :require => "active_record"
12
12
 
13
13
  group :tools do
14
- gem "byebug", :platform => [:ruby_20, :ruby_21]
14
+ gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
15
15
  gem "debugger", :platform => :ruby_19
16
16
  end
17
17
 
@@ -11,7 +11,7 @@ gem "fuubar"
11
11
  gem "activerecord", "~> 4.2", :require => "active_record"
12
12
 
13
13
  group :tools do
14
- gem "byebug", :platform => [:ruby_20, :ruby_21]
14
+ gem "byebug", :platform => [:ruby_20, :ruby_21, :ruby_22]
15
15
  gem "debugger", :platform => :ruby_19
16
16
  end
17
17
 
@@ -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
@@ -1,7 +1,7 @@
1
1
  module JamJar
2
2
  module VERSION
3
3
  MAJOR = 1
4
- MINOR = 1
4
+ MINOR = 2
5
5
  PATCH = 0
6
6
 
7
7
  BETA = nil
@@ -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
@@ -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.1.0
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: 2014-12-29 00:00:00.000000000 Z
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.3
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.