assertion 0.2.2 → 0.2.3

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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b3c17905def77d1f6f9366a2fd4f3a7326cf5c8c
4
- data.tar.gz: eeb118194902e69f6ab5ab44a77183e2d0f32ebe
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ Mzk3MGE0ZjJjODM1Y2YxNzAyOGQzZjY0Yzk2N2YwZTVjZDI2NWI2OA==
5
+ data.tar.gz: !binary |-
6
+ NzUwZjQ2NDA5MzM5NDU5MmJiMWU3NGQ3ZThlM2Q3MjM2MDM2OTM5MQ==
5
7
  SHA512:
6
- metadata.gz: 8dfbe9226b7fede756b1b9e30890b880afa3495758677d1b2530900f44ddf0fbf3b27d56101bb984c4d8e426902647d6c17319dfcc2a6765ad8bf001a8bd53f3
7
- data.tar.gz: 5e99ccb9c8a6228f0f027556dc0cacf4ec2f099a1a3cfa947a2843ab34e96c17512d0074888aaee44f3c5c5a86c8ab86c7a12ddd8b2659f90b5dbbdf55503ed2
8
+ metadata.gz: !binary |-
9
+ NDRhZjI5ZmY3MWMwNzQ3NTRhOWVhOTczYjE0OTliNGI2NDZjYjg3MWI1Nzgx
10
+ ZjE5OWUyODAzMDFmMDYxOTcwMDc1M2MxZjMwOThiODhjYjI0ZDBiZmQ4ODcy
11
+ MjdkNmFkMmQxMDhiMjJjOTUyMmM0MTQ1ZTdkODg2ODFhZmE3ZGM=
12
+ data.tar.gz: !binary |-
13
+ ZDkyMjZkNDk3NzhhYjExYTBmNzlkY2U1YjkxMzg1ZTQwYjMwMTRjMzZkN2Rj
14
+ MDBlMTFjMzBjNGU5MmY3ZTI4OWMwOGQ1MTE1ZDM1MzY0MTg5ZDdjMzNmMjAx
15
+ NjM3YWRhNGVmYjE2NzZhNmRlMzFlZTU2YTQ1YzE5NzFiYmEwNmM=
@@ -2,6 +2,7 @@
2
2
  language: ruby
3
3
  bundler_args: --without metrics
4
4
  cache: bundler
5
+ script: bundle exec rake test:coverage:run
5
6
  rvm:
6
7
  - '1.9.3'
7
8
  - '2.0'
@@ -1,3 +1,19 @@
1
+ ## v0.2.3 2015-07-12
2
+
3
+ The version is bumped to fix bugs that proved to be hidden because of bugs in hexx-rspec and hexx-suit gems.
4
+
5
+ ### Bugs fixed
6
+
7
+ * Fixed incompatibility to ruby 1.9.3 (nepalez)
8
+ * Fixed Rakefile that tried to loade wrong version of Rake (nepalez)
9
+
10
+ ### Internals
11
+
12
+ * Updated specs for compatibility to rubies 2.2-, jruby and rbx (nepalez)
13
+ * Switched to updated 'hexx-rspec' (nepalez)
14
+
15
+ [Compare v0.2.2...v0.2.3](https://github.com/nepalez/assertion/compare/v0.2.2...0.2.3)
16
+
1
17
  ## v0.2.2 2015-07-11
2
18
 
3
19
  ### Added
data/Gemfile CHANGED
@@ -3,5 +3,5 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  group :metrics do
6
- gem "hexx-suit", "~> 2.2" if RUBY_ENGINE == "ruby"
6
+ gem "hexx-suit", "~> 2.3.2" if RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.1"
7
7
  end
data/Rakefile CHANGED
@@ -1,10 +1,6 @@
1
1
  # encoding: utf-8
2
- begin
3
- require "bundler/setup"
4
- rescue LoadError
5
- puts "You must `gem install bundler` and `bundle install` to run rake tasks"
6
- exit
7
- end
2
+ require "rubygems"
3
+ require "bundler/setup"
8
4
 
9
5
  # Loads bundler tasks
10
6
  Bundler::GemHelper.install_tasks
@@ -22,7 +22,7 @@ Gem::Specification.new do |gem|
22
22
  gem.add_runtime_dependency "ice_nine", "~> 0.11"
23
23
  gem.add_runtime_dependency "inflecto", "~> 0.0"
24
24
 
25
- gem.add_development_dependency "hexx-rspec", "~> 0.4"
25
+ gem.add_development_dependency "hexx-rspec", "~> 0.5"
26
26
  gem.add_development_dependency "equalizer", "~> 0.0"
27
27
 
28
28
  end # Gem::Specification
@@ -39,7 +39,8 @@ module Assertion
39
39
 
40
40
  def __add_attribute__(name)
41
41
  __check_attribute__(name)
42
- attributes << define_method(name) { attributes[name] }
42
+ define_method(name) { attributes[name] }
43
+ attributes << name.to_sym
43
44
  end
44
45
 
45
46
  def __check_attribute__(name)
@@ -4,6 +4,6 @@ module Assertion
4
4
 
5
5
  # The semantic version of the module.
6
6
  # @see http://semver.org/ Semantic versioning 2.0
7
- VERSION = "0.2.2".freeze
7
+ VERSION = "0.2.3".freeze
8
8
 
9
9
  end # module Assertion
@@ -13,7 +13,7 @@ describe Assertion do
13
13
  end
14
14
 
15
15
  AdultOnly = Assertion.guards :user do
16
- IsAdult[user.to_h]
16
+ IsAdult[name: user.name, age: user.age]
17
17
  end
18
18
 
19
19
  andrew = OpenStruct.new(name: "Andrew", age: 13, city: "Moscow")
@@ -54,7 +54,7 @@ describe Assertion::Base do
54
54
  let(:klass) { Class.new(described_class) { attribute :foo } }
55
55
  let(:assertion) { klass.new(foo: :FOO) }
56
56
 
57
- shared_examples "translating" do |as: nil|
57
+ shared_examples "translating" do |options|
58
58
 
59
59
  let(:translator) { Assertion::Translator.new(klass) }
60
60
  let(:attributes) { assertion.attributes }
@@ -67,7 +67,7 @@ describe Assertion::Base do
67
67
  end
68
68
 
69
69
  it "returns a translation" do
70
- expect(subject).to eql translator.call(as, attributes)
70
+ expect(subject).to eql translator.call(options[:as], attributes)
71
71
  end
72
72
 
73
73
  end # shared examples
@@ -21,24 +21,25 @@ describe Assertion::DSL::Attribute do
21
21
 
22
22
  before { klass.send(:define_method, :object) { :object } }
23
23
 
24
- shared_examples "aliasing #object" do |with: nil|
24
+ shared_examples "aliasing #object" do |options|
25
25
 
26
- before { klass.attribute with }
26
+ before { klass.attribute options[:with] }
27
27
  let(:instance) { klass.new }
28
- subject { instance.send with }
28
+ subject { instance.send options[:with] }
29
29
 
30
30
  it { is_expected.to eql instance.object }
31
31
 
32
32
  end # shared examples
33
33
 
34
- shared_examples "complaining about wrong name" do |with: nil|
34
+ shared_examples "complaining about wrong name" do |options|
35
35
 
36
- subject { klass.attribute with }
36
+ subject { klass.attribute options[:with] }
37
37
 
38
38
  it "fails" do
39
39
  expect { subject }.to raise_error do |error|
40
40
  expect(error).to be_kind_of NameError
41
- expect(error.message).to eql "#{klass}##{with} is already defined"
41
+ expect(error.message)
42
+ .to eql "#{klass}##{options[:with]} is already defined"
42
43
  end
43
44
  end
44
45
 
@@ -8,7 +8,7 @@ describe Assertion::Guard do
8
8
  IsAdult = Assertion.about(:age) { age.to_i >= 18 }
9
9
  AdultOnly = Class.new(described_class) do
10
10
  def state
11
- IsAdult[object.to_h]
11
+ IsAdult[name: object.name, age: object.age]
12
12
  end
13
13
  end
14
14
  end
@@ -29,12 +29,12 @@ describe Assertion::Translator do
29
29
 
30
30
  describe "#call" do
31
31
 
32
- shared_examples "translating" do |input, to: nil|
32
+ shared_examples "translating" do |input, opts|
33
33
 
34
34
  subject { translator.call(input) }
35
35
 
36
36
  let(:attributes) { { foo: :FOO, bar: :BAR } }
37
- let(:output) { "translation missing: en.assertion.is_foo.#{to}" }
37
+ let(:output) { "translation missing: en.assertion.is_foo.#{opts[:to]}" }
38
38
 
39
39
  it "provides translation" do
40
40
  expect(translator.call input).to eql output
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assertion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kozin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-11 00:00:00.000000000 Z
11
+ date: 2015-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ice_nine
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.11'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.11'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: inflecto
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: hexx-rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0.4'
61
+ version: '0.5'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: '0.4'
68
+ version: '0.5'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: equalizer
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.0'
83
83
  description:
@@ -88,13 +88,13 @@ extra_rdoc_files:
88
88
  - README.md
89
89
  - LICENSE
90
90
  files:
91
- - ".coveralls.yml"
92
- - ".gitignore"
93
- - ".metrics"
94
- - ".rspec"
95
- - ".rubocop.yml"
96
- - ".travis.yml"
97
- - ".yardopts"
91
+ - .coveralls.yml
92
+ - .gitignore
93
+ - .metrics
94
+ - .rspec
95
+ - .rubocop.yml
96
+ - .travis.yml
97
+ - .yardopts
98
98
  - CHANGELOG.md
99
99
  - Gemfile
100
100
  - Guardfile
@@ -158,12 +158,12 @@ require_paths:
158
158
  - lib
159
159
  required_ruby_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - "~>"
161
+ - - ~>
162
162
  - !ruby/object:Gem::Version
163
163
  version: '1.9'
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - ">="
166
+ - - ! '>='
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []