flexmock 2.0.5 → 2.0.6

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: 158433b510fe021438b3e2c88a82b1ffd0efcb36
4
- data.tar.gz: 65961b49054d7ff956bf6807d007aadb0b1105a9
3
+ metadata.gz: 33bb2c48e90a98ffbe177d885fdedd82aa7c7fc8
4
+ data.tar.gz: 2c6dfcfac4032dd6fdd3110c204f5c91939e4104
5
5
  SHA512:
6
- metadata.gz: ed5f37949186a46a14c4391ee4987f9b314acf1d876979a538704957526d24f7e1f6a67f00fd27a31d668b1b5086537a8a805269baae81d799059a3e041f94b3
7
- data.tar.gz: 0c92dadcc4e1bea6951214e0e43704d6e677201ed53ea370eea3ad4ddfd9b60b6ec28a56264f98b59b73b216a7afdb830ce24376a1aa6836be78e12e38c5d296
6
+ metadata.gz: 74fdc213dda95788d74cfd973f2f7309611d0b21838c309d2c86a8013660f42057685d7f198498ff878f6fae34e3e4e3b27886ff5eb6e36a771bdfcca4e291fe
7
+ data.tar.gz: 558319ae76251ca95e1eaedd13114ecf77540e95160700595a01a07f86cb027cc84b4c64317518ae7a189b18431343d55254204756e87d91943df2c6913c34fb
data/.travis.yml CHANGED
@@ -4,6 +4,7 @@ rvm:
4
4
  - 2.1.8
5
5
  - 2.2.4
6
6
  - 2.3.0
7
+ - jruby-9.0.5.0
7
8
 
8
9
  script:
9
10
  - rake test
data/lib/flexmock/core.rb CHANGED
@@ -146,6 +146,10 @@ class FlexMock
146
146
  @expectations[method_name]
147
147
  end
148
148
 
149
+ def flexmock_base_class
150
+ @base_class
151
+ end
152
+
149
153
  def flexmock_based_on(base_class)
150
154
  @base_class = base_class
151
155
  if base_class <= Kernel
@@ -105,9 +105,15 @@ class FlexMock
105
105
  when :base, :safe
106
106
  opts.safe_mode = (args.shift == :safe)
107
107
  opts.domain_obj = args.shift
108
- when :on
109
- args.shift
110
- opts.base_class = args.shift
108
+ when :on, :strict
109
+ if args.shift == :strict
110
+ if !opts.domain_obj
111
+ raise ArgumentError, "cannot use :strict outside a partial mock"
112
+ end
113
+ opts.base_class = opts.domain_obj.class
114
+ else
115
+ opts.base_class = args.shift
116
+ end
111
117
  opts.name ||= "#{opts.base_class} Mock"
112
118
  else
113
119
  CONTAINER_HELPER.extensions.each do |ext|
@@ -1,3 +1,3 @@
1
1
  class FlexMock
2
- VERSION = "2.0.5"
2
+ VERSION = "2.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexmock
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Weirich
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-29 00:00:00.000000000 Z
12
+ date: 2016-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest