warp 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3adb8eb57a1a07e3946d9a6509ab2c5b3c0f3a7c
4
- data.tar.gz: 5bcbf3b706f9357ce933dbe0660df9e743250c51
3
+ metadata.gz: e70da9075f2beae56344d463b528607d1f18b1ec
4
+ data.tar.gz: 8c6ed89c28d1e174b2ac313267dc8665f176b3f4
5
5
  SHA512:
6
- metadata.gz: f78ea0011cfa93e17bde6342e458159a8db8ba06bee83befd6522e7473d2b09f7a2cef25a44245031ebbf7ee970c868755facf0d835c217d33dac08c875f17fe
7
- data.tar.gz: aaeaeb5a5ed4101a166c4727a6bb2376d659744e65bebb7fcb028a58c57e2841a6a3b8e3320b6ad6209eb310991b53796da6b69b446505b5e491283b83ef87c7
6
+ metadata.gz: 61e2ab2c14102df7ed581ab6d4a81d1889aaa852650b77b6113c7181dda8204154fd41fb0c01db05e564e8182aa19df4b4d889c28320e728d6b7be4f4de0169b
7
+ data.tar.gz: b1a7666e777fcb4ba6aeb1c25830b189870399e1ac80868a3350ca21c6fddbbca9ed40dddb523c5951574a05759684c9e85abdc6ecd932d7003a23df5a266e10
@@ -1,13 +1,14 @@
1
1
  language: ruby
2
2
 
3
+ sudo: false
4
+ cache: bundler
5
+
3
6
  env:
4
7
  global:
5
8
  - TRAVIS_CI=1
6
9
 
7
10
  rvm:
8
11
  - 1.9.3
9
- - 2.0.0
10
- - 2.1.5
11
12
  - 2.2.1
12
13
 
13
14
  gemfile:
@@ -1,3 +1,6 @@
1
+ - 1.5.0
2
+ - Reinstated HABTM matcher for Rails 4.1+
3
+
1
4
  - 1.4.0
2
5
  - Dropped support for RSpec 2.
3
6
  - Assignment matchers handle nil values better.
@@ -4,7 +4,7 @@ module Warp
4
4
  module ModelMatchers
5
5
  class AssociationMatcher < Warp::ModelMatchers::Matcher
6
6
  attr_reader :expected_macro, :key
7
-
7
+
8
8
  def initialize(expected_macro, key)
9
9
  @expected_macro = expected_macro
10
10
  @key = key
@@ -56,11 +56,7 @@ module Warp
56
56
  end
57
57
 
58
58
  def have_and_belong_to_many(key)
59
- if ActiveRecord::VERSION::STRING[0] == "4" && ActiveRecord::VERSION::STRING[3] != "0"
60
- raise NotImplementedError, "In Rail 4.1+ the has_and_belongs_to_many helper produces a has_many :through association."
61
- else
62
- AssociationMatcher.new(:has_and_belongs_to_many, key)
63
- end
59
+ AssociationMatcher.new(:has_and_belongs_to_many, key)
64
60
  end
65
61
  end
66
- end
62
+ end
@@ -1,7 +1,7 @@
1
1
  module Warp
2
2
  module VERSION
3
3
  MAJOR = 1
4
- MINOR = 4
4
+ MINOR = 5
5
5
  PATCH = 0
6
6
 
7
7
  BETA = nil
@@ -20,16 +20,12 @@ describe Warp::ModelMatchers::AssociationMatcher, type: :model do
20
20
  end
21
21
 
22
22
  behaviour do
23
- if ActiveRecord::VERSION::STRING[0] == "4" && ActiveRecord::VERSION::STRING[3] != "0"
24
- specify { expect{ have_and_belong_to_many(:foo) }.to raise_error(NotImplementedError) }
25
- end
26
-
27
23
  with_contexts do
28
24
  let(:no_association_key) { :foobar }
29
25
 
30
26
  describe "#have_many" do
31
27
  let(:matcher) { have_many(key) }
32
-
28
+
33
29
  let(:matcher_macro) { :has_many }
34
30
  let(:association_key) { :bars }
35
31
  let(:wrong_association_key) { :foo }
@@ -37,7 +33,7 @@ describe Warp::ModelMatchers::AssociationMatcher, type: :model do
37
33
 
38
34
  describe "#have_one" do
39
35
  let(:matcher) { have_one(key) }
40
-
36
+
41
37
  let(:matcher_macro) { :has_one }
42
38
  let(:association_key) { :baz }
43
39
  let(:wrong_association_key) { :foo }
@@ -45,21 +41,18 @@ describe Warp::ModelMatchers::AssociationMatcher, type: :model do
45
41
 
46
42
  describe "#belong_to" do
47
43
  let(:matcher) { belong_to(key) }
48
-
44
+
49
45
  let(:matcher_macro) { :belongs_to }
50
46
  let(:association_key) { :foo }
51
47
  let(:wrong_association_key) { :bars }
52
48
  end
53
49
 
54
-
55
- unless ActiveRecord::VERSION::STRING[0] == "4" && ActiveRecord::VERSION::STRING[3] != "0"
56
- describe "#have_and_belong_to_many" do
57
- let(:matcher) { have_and_belong_to_many(key) }
58
-
59
- let(:matcher_macro) { :has_and_belongs_to_many }
60
- let(:association_key) { :qux }
61
- let(:wrong_association_key) { :foo }
62
- end
50
+ describe "#have_and_belong_to_many" do
51
+ let(:matcher) { have_and_belong_to_many(key) }
52
+
53
+ let(:matcher_macro) { :has_and_belongs_to_many }
54
+ let(:association_key) { :qux }
55
+ let(:wrong_association_key) { :foo }
63
56
  end
64
57
 
65
58
  behaviour do
@@ -70,7 +63,7 @@ describe Warp::ModelMatchers::AssociationMatcher, type: :model do
70
63
  let(:key) { association_key }
71
64
 
72
65
  specify { expect(subject).to match(model_or_instance) }
73
-
66
+
74
67
  describe_failure_message_when_negated do
75
68
  specify { expect(subject).to eq "expected TestModel to not have a #{matcher_macro} association with :#{key}" }
76
69
  end
@@ -81,7 +74,7 @@ describe Warp::ModelMatchers::AssociationMatcher, type: :model do
81
74
  let(:actual_macro) { model.reflect_on_association(key).macro }
82
75
 
83
76
  specify { expect(subject).to_not match(model_or_instance) }
84
-
77
+
85
78
  describe_failure_message do
86
79
  specify { expect(subject).to eq "expected TestModel to have a #{matcher_macro} association with :#{key}, but had a #{actual_macro} association with :#{key}" }
87
80
  end
@@ -92,7 +85,7 @@ describe Warp::ModelMatchers::AssociationMatcher, type: :model do
92
85
  let(:key) { no_association_key }
93
86
 
94
87
  specify { expect(subject).to_not match(model_or_instance) }
95
-
88
+
96
89
  describe_failure_message do
97
90
  specify { expect(subject).to eq "expected TestModel to have a #{matcher_macro} association with :#{key}" }
98
91
  end
@@ -101,4 +94,4 @@ describe Warp::ModelMatchers::AssociationMatcher, type: :model do
101
94
  end
102
95
  end
103
96
  end
104
- end
97
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.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: 2015-08-10 00:00:00.000000000 Z
11
+ date: 2015-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -88,9 +88,9 @@ files:
88
88
  - spec/warp/controller_matchers/assign_matcher_spec.rb
89
89
  - spec/warp/controller_matchers/set_flash_matcher_spec.rb
90
90
  - spec/warp/instrument_spec.rb
91
- - spec/warp/model_helpers/association_matcher_spec.rb
92
- - spec/warp/model_helpers/attribute_matcher_spec.rb
93
- - spec/warp/model_helpers/validation_matcher_spec.rb
91
+ - spec/warp/model_matchers/association_matcher_spec.rb
92
+ - spec/warp/model_matchers/attribute_matcher_spec.rb
93
+ - spec/warp/model_matchers/validation_matcher_spec.rb
94
94
  - warp.gemspec
95
95
  homepage: https://github.com/thomasfedb/warp
96
96
  licenses:
@@ -128,6 +128,6 @@ test_files:
128
128
  - spec/warp/controller_matchers/assign_matcher_spec.rb
129
129
  - spec/warp/controller_matchers/set_flash_matcher_spec.rb
130
130
  - spec/warp/instrument_spec.rb
131
- - spec/warp/model_helpers/association_matcher_spec.rb
132
- - spec/warp/model_helpers/attribute_matcher_spec.rb
133
- - spec/warp/model_helpers/validation_matcher_spec.rb
131
+ - spec/warp/model_matchers/association_matcher_spec.rb
132
+ - spec/warp/model_matchers/attribute_matcher_spec.rb
133
+ - spec/warp/model_matchers/validation_matcher_spec.rb