bogus 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. data/Gemfile.lock +53 -34
  2. data/Guardfile +3 -1
  3. data/Guardfile.cucumber +2 -0
  4. data/README.md +2 -1
  5. data/bogus.gemspec +1 -0
  6. data/features/.nav +2 -0
  7. data/features/changelog.md +8 -0
  8. data/features/contract_tests/custom_overwritten_class.feature +115 -0
  9. data/features/minitest_support.feature +228 -0
  10. data/lib/bogus.rb +3 -3
  11. data/lib/bogus/contracts/adds_contract_verification.rb +55 -0
  12. data/lib/bogus/{adds_recording.rb → contracts/adds_recording.rb} +2 -3
  13. data/lib/bogus/{contract_not_fulfilled.rb → contracts/contract_not_fulfilled.rb} +0 -0
  14. data/lib/bogus/{interactions_repository.rb → contracts/interactions_repository.rb} +0 -0
  15. data/lib/bogus/{proxy_class.rb → contracts/proxy_class.rb} +0 -0
  16. data/lib/bogus/{recording_proxy.rb → contracts/recording_proxy.rb} +0 -0
  17. data/lib/bogus/{records_double_interactions.rb → contracts/records_double_interactions.rb} +0 -0
  18. data/lib/bogus/{verifies_contracts.rb → contracts/verifies_contracts.rb} +0 -0
  19. data/lib/bogus/{active_record_accessors.rb → fakes/active_record_accessors.rb} +0 -0
  20. data/lib/bogus/fakes/base_class_identifier.rb +39 -0
  21. data/lib/bogus/{class_methods.rb → fakes/class_methods.rb} +0 -0
  22. data/lib/bogus/{constructor_methods.rb → fakes/constructor_methods.rb} +0 -0
  23. data/lib/bogus/{converts_name_to_class.rb → fakes/converts_name_to_class.rb} +0 -0
  24. data/lib/bogus/{copies_classes.rb → fakes/copies_classes.rb} +8 -0
  25. data/lib/bogus/{copies_methods.rb → fakes/copies_methods.rb} +0 -0
  26. data/lib/bogus/{creates_fakes.rb → fakes/creates_fakes.rb} +0 -0
  27. data/lib/bogus/{creates_fakes_with_stubbed_methods.rb → fakes/creates_fakes_with_stubbed_methods.rb} +0 -0
  28. data/lib/bogus/{fake.rb → fakes/fake.rb} +4 -12
  29. data/lib/bogus/{fake_registry.rb → fakes/fake_registry.rb} +0 -0
  30. data/lib/bogus/{fakes_classes.rb → fakes/fakes_classes.rb} +0 -0
  31. data/lib/bogus/{instance_methods.rb → fakes/instance_methods.rb} +0 -0
  32. data/lib/bogus/{makes_ducks.rb → fakes/makes_ducks.rb} +0 -0
  33. data/lib/bogus/{makes_substitute_methods.rb → fakes/makes_substitute_methods.rb} +0 -0
  34. data/lib/bogus/{makes_subtypes.rb → fakes/makes_subtypes.rb} +0 -0
  35. data/lib/bogus/{method_stringifier.rb → fakes/method_stringifier.rb} +0 -0
  36. data/lib/bogus/{overwriten_classes.rb → fakes/overwriten_classes.rb} +0 -0
  37. data/lib/bogus/{overwrites_classes.rb → fakes/overwrites_classes.rb} +0 -0
  38. data/lib/bogus/{registers_created_fakes.rb → fakes/registers_created_fakes.rb} +0 -0
  39. data/lib/bogus/{resets_overwritten_classes.rb → fakes/resets_overwritten_classes.rb} +0 -0
  40. data/lib/bogus/{responds_to_everything.rb → fakes/responds_to_everything.rb} +0 -0
  41. data/lib/bogus/injector.rb +4 -0
  42. data/lib/bogus/minitest.rb +10 -7
  43. data/lib/bogus/minitest/spec.rb +7 -0
  44. data/lib/bogus/minitest/syntax.rb +27 -0
  45. data/lib/bogus/public_methods.rb +4 -0
  46. data/lib/bogus/{rspec_adapter.rb → rspec/adapter.rb} +0 -0
  47. data/lib/bogus/rspec/extensions.rb +21 -0
  48. data/lib/bogus/rspec/syntax.rb +20 -0
  49. data/lib/bogus/{any_args.rb → stubbing/any_args.rb} +0 -0
  50. data/lib/bogus/{anything.rb → stubbing/anything.rb} +0 -0
  51. data/lib/bogus/{default_value.rb → stubbing/default_value.rb} +0 -0
  52. data/lib/bogus/{double.rb → stubbing/double.rb} +0 -0
  53. data/lib/bogus/{ensures_all_interactions_satisfied.rb → stubbing/ensures_all_interactions_satisfied.rb} +0 -0
  54. data/lib/bogus/{has_overwritten_methods.rb → stubbing/has_overwritten_methods.rb} +0 -0
  55. data/lib/bogus/{have_received_matcher.rb → stubbing/have_received_matcher.rb} +0 -0
  56. data/lib/bogus/{interaction.rb → stubbing/interaction.rb} +0 -0
  57. data/lib/bogus/{interaction_presenter.rb → stubbing/interaction_presenter.rb} +0 -0
  58. data/lib/bogus/{multi_stubber.rb → stubbing/multi_stubber.rb} +0 -0
  59. data/lib/bogus/{not_all_expectations_satisfied.rb → stubbing/not_all_expectations_satisfied.rb} +0 -0
  60. data/lib/bogus/{overwrites_methods.rb → stubbing/overwrites_methods.rb} +0 -0
  61. data/lib/bogus/{record_interactions.rb → stubbing/record_interactions.rb} +0 -0
  62. data/lib/bogus/{resets_stubbed_methods.rb → stubbing/resets_stubbed_methods.rb} +0 -0
  63. data/lib/bogus/{same_class.rb → stubbing/same_class.rb} +0 -0
  64. data/lib/bogus/{shadow.rb → stubbing/shadow.rb} +0 -0
  65. data/lib/bogus/{tracks_existence_of_test_doubles.rb → stubbing/tracks_existence_of_test_doubles.rb} +0 -0
  66. data/lib/bogus/{undefined_return_value.rb → stubbing/undefined_return_value.rb} +4 -0
  67. data/lib/bogus/{verifies_stub_definition.rb → stubbing/verifies_stub_definition.rb} +0 -0
  68. data/lib/bogus/version.rb +1 -1
  69. data/license.md +9 -0
  70. data/spec/bogus/contracts/adds_contract_verification_spec.rb +154 -0
  71. data/spec/bogus/contracts/adds_recording_spec.rb +43 -0
  72. data/spec/bogus/{interactions_repository_spec.rb → contracts/interactions_repository_spec.rb} +0 -0
  73. data/spec/bogus/{proxy_class_spec.rb → contracts/proxy_class_spec.rb} +0 -0
  74. data/spec/bogus/{records_double_interactions_spec.rb → contracts/records_double_interactions_spec.rb} +0 -0
  75. data/spec/bogus/{verifies_contracts_spec.rb → contracts/verifies_contracts_spec.rb} +0 -0
  76. data/spec/bogus/fakes/base_class_identifier_spec.rb +67 -0
  77. data/spec/bogus/{class_methods_spec.rb → fakes/class_methods_spec.rb} +0 -0
  78. data/spec/bogus/{converts_name_to_class_spec.rb → fakes/converts_name_to_class_spec.rb} +1 -1
  79. data/spec/bogus/{copies_classes_spec.rb → fakes/copies_classes_spec.rb} +3 -7
  80. data/spec/bogus/{creates_fakes_spec.rb → fakes/creates_fakes_spec.rb} +1 -1
  81. data/spec/bogus/{creates_fakes_with_stubbed_methods_spec.rb → fakes/creates_fakes_with_stubbed_methods_spec.rb} +0 -0
  82. data/spec/bogus/{fake_ar_attributes_spec.rb → fakes/fake_ar_attributes_spec.rb} +0 -0
  83. data/spec/bogus/{fake_configuration_spec.rb → fakes/fake_configuration_spec.rb} +0 -0
  84. data/spec/bogus/{fake_registry_spec.rb → fakes/fake_registry_spec.rb} +0 -0
  85. data/spec/bogus/fakes/fake_spec.rb +8 -0
  86. data/spec/bogus/{fakes_classes_spec.rb → fakes/fakes_classes_spec.rb} +0 -0
  87. data/spec/bogus/{faking_factories_spec.rb → fakes/faking_factories_spec.rb} +0 -0
  88. data/spec/bogus/{frozen_fakes_spec.rb → fakes/frozen_fakes_spec.rb} +0 -0
  89. data/spec/bogus/{instance_methods_spec.rb → fakes/instance_methods_spec.rb} +0 -0
  90. data/spec/bogus/{makes_ducks_spec.rb → fakes/makes_ducks_spec.rb} +0 -0
  91. data/spec/bogus/{makes_substitute_methods_spec.rb → fakes/makes_substitute_methods_spec.rb} +0 -0
  92. data/spec/bogus/{method_copiers_spec.rb → fakes/method_copiers_spec.rb} +0 -0
  93. data/spec/bogus/{overwriten_classes_spec.rb → fakes/overwriten_classes_spec.rb} +0 -0
  94. data/spec/bogus/{overwrites_classes_spec.rb → fakes/overwrites_classes_spec.rb} +0 -0
  95. data/spec/bogus/{registers_created_fakes_spec.rb → fakes/registers_created_fakes_spec.rb} +0 -0
  96. data/spec/bogus/{resets_overwritten_classes_spec.rb → fakes/resets_overwritten_classes_spec.rb} +0 -0
  97. data/spec/bogus/mocking_dsl_spec.rb +2 -2
  98. data/spec/bogus/{anything_spec.rb → stubbing/anything_spec.rb} +0 -0
  99. data/spec/bogus/{double_spec.rb → stubbing/double_spec.rb} +0 -0
  100. data/spec/bogus/{ensures_all_interactions_satisfied_spec.rb → stubbing/ensures_all_interactions_satisfied_spec.rb} +0 -0
  101. data/spec/bogus/{have_received_matcher_spec.rb → stubbing/have_received_matcher_spec.rb} +0 -0
  102. data/spec/bogus/{interaction_spec.rb → stubbing/interaction_spec.rb} +0 -0
  103. data/spec/bogus/{multi_stubber_spec.rb → stubbing/multi_stubber_spec.rb} +0 -0
  104. data/spec/bogus/{overwrites_methods_spec.rb → stubbing/overwrites_methods_spec.rb} +0 -0
  105. data/spec/bogus/{record_interactions_spec.rb → stubbing/record_interactions_spec.rb} +0 -0
  106. data/spec/bogus/{resets_stubbed_methods_spec.rb → stubbing/resets_stubbed_methods_spec.rb} +0 -0
  107. data/spec/bogus/{shadow_spec.rb → stubbing/shadow_spec.rb} +0 -0
  108. data/spec/bogus/{tracks_existence_of_test_doubles_spec.rb → stubbing/tracks_existence_of_test_doubles_spec.rb} +0 -0
  109. data/spec/bogus/stubbing/undefined_return_value_spec.rb +18 -0
  110. data/spec/bogus/{verifies_stub_definition_spec.rb → stubbing/verifies_stub_definition_spec.rb} +0 -0
  111. metadata +176 -160
  112. data/features/minitest/minitest_support.feature +0 -119
  113. data/lib/bogus/rspec_extensions.rb +0 -31
  114. data/spec/bogus/adds_recording_spec.rb +0 -77
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+
3
+ describe Bogus::AddsRecording do
4
+ module SampleModule
5
+ class Library
6
+ end
7
+
8
+ class OtherClass
9
+ end
10
+ end
11
+
12
+ let(:create_proxy_class) { stub }
13
+ let(:overwrites_classes) { stub }
14
+ let(:overwritten_classes) { stub }
15
+
16
+ let(:adds_recording) { isolate(Bogus::AddsRecording) }
17
+
18
+ before do
19
+ stub(create_proxy_class).call { Object }
20
+ stub(overwrites_classes).overwrite
21
+ stub(overwritten_classes).add
22
+ end
23
+
24
+ before do
25
+ adds_recording.add(:library, SampleModule::Library)
26
+ end
27
+
28
+ it "creates the proxy" do
29
+ create_proxy_class.should have_received.call(:library, SampleModule::Library)
30
+ end
31
+
32
+ it "swaps the classes" do
33
+ overwrites_classes.should have_received.overwrite('SampleModule::Library', Object)
34
+ end
35
+
36
+ it "records the overwritten class, so that it can be later restored" do
37
+ overwritten_classes.should have_received.add("SampleModule::Library", SampleModule::Library)
38
+ end
39
+
40
+ it "returns the proxy class" do
41
+ adds_recording.add(:library, SampleModule::Library).should == Object
42
+ end
43
+ end
@@ -0,0 +1,67 @@
1
+ require 'spec_helper'
2
+
3
+ module SampleForBaseIdentifier
4
+ describe Bogus::BaseClassIdentifier do
5
+ module Foo
6
+ def foo; end
7
+ end
8
+
9
+ module Bar
10
+ include Foo
11
+ def bar; end
12
+ end
13
+
14
+ module Baz
15
+ def baz; end
16
+ end
17
+
18
+ module OtherModule
19
+ end
20
+
21
+ class SuperBase
22
+ end
23
+
24
+ class BaseClass < SuperBase
25
+ include Bar
26
+ def x; end
27
+ end
28
+
29
+ class SubClass < BaseClass
30
+ include Baz
31
+ def y; end
32
+ end
33
+
34
+ class OtherClass
35
+ end
36
+
37
+ class BarInstance
38
+ include Bar
39
+ end
40
+
41
+ def self.it_returns_the_same_value_as_a_regular_instance
42
+ klasses = [Foo, Bar, Baz, OtherModule,
43
+ SuperBase, BaseClass, SubClass, OtherClass]
44
+ klasses.each do |klass|
45
+ it "returns the same for is_a?(#{klass})" do
46
+ expected = instance.is_a?(klass)
47
+ actual = Bogus::BaseClassIdentifier.base_class?(copied_class, klass)
48
+ actual.should == expected
49
+ end
50
+ end
51
+ end
52
+
53
+ context "with copied module" do
54
+ let(:copied_class) { Bar }
55
+ let(:instance) { BarInstance.new }
56
+
57
+ it_returns_the_same_value_as_a_regular_instance
58
+ end
59
+
60
+ context "with copied class" do
61
+ let(:copied_class) { SubClass }
62
+ let(:instance) { SubClass.new }
63
+
64
+ it_returns_the_same_value_as_a_regular_instance
65
+ end
66
+ end
67
+ end
@@ -1,4 +1,4 @@
1
- require_relative '../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Bogus::ConvertsNameToClass do
4
4
  FooBarBaz = Class.new
@@ -125,15 +125,15 @@ describe Bogus::CopiesClasses do
125
125
  end
126
126
 
127
127
  it "should override kind_of?" do
128
- fake.should be_kind_of(SomeModule::SomeClass)
128
+ fake.kind_of?(SomeModule::SomeClass).should be_true
129
129
  end
130
130
 
131
131
  it "should override instance_of?" do
132
- fake.should be_instance_of(SomeModule::SomeClass)
132
+ fake.instance_of?(SomeModule::SomeClass).should be_true
133
133
  end
134
134
 
135
135
  it "should override is_a?" do
136
- fake.should be_a(SomeModule::SomeClass)
136
+ fake.is_a?(SomeModule::SomeClass).should be_true
137
137
  end
138
138
 
139
139
  it "should include class name in the output of fake's class #to_s" do
@@ -143,10 +143,6 @@ describe Bogus::CopiesClasses do
143
143
  it "should include class name in the output of fake's #to_s" do
144
144
  fake.to_s.should include(klass.name)
145
145
  end
146
-
147
- # TODO
148
- it "should override kind_of?/instance_of? for base classes of copied class"
149
- it "should override kind_of? for modules included into copied class"
150
146
  end
151
147
 
152
148
  shared_examples_for 'spying' do
@@ -1,4 +1,4 @@
1
- require_relative '../spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe Bogus::CreatesFakes do
4
4
  let(:fake_class) { stub }
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ describe Bogus::Fake do
4
+ it 'has a class name' do
5
+ Bogus::Fake.name.should == "Bogus::Fake"
6
+ end
7
+ end
8
+
@@ -134,7 +134,7 @@ describe Bogus::MockingDSL do
134
134
  end
135
135
 
136
136
  it "can be used with self references" do
137
- Bogus.record_calls_for(:passes_self_to_collaborator)
137
+ Bogus.record_calls_for(:passes_self_to_collaborator, PassesSelfToCollaborator)
138
138
 
139
139
  fake = Bogus.fake_for(:example_foo)
140
140
  object = PassesSelfToCollaborator.new
@@ -381,7 +381,7 @@ describe Bogus::MockingDSL do
381
381
 
382
382
  Bogus.after_each_test
383
383
 
384
- Bogus.record_calls_for(:sample_for_contracts)
384
+ Bogus.record_calls_for(:sample_for_contracts, SampleForContracts)
385
385
  end
386
386
 
387
387
  it "passes when all the mocked interactions were executed" do
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe Bogus::UndefinedReturnValue do
4
+ let(:interaction) { Bogus::Interaction.new(:foo, ["bar"]) }
5
+ let(:undefined_return_value) { Bogus::UndefinedReturnValue.new(interaction) }
6
+
7
+ it "includes the interaction when stringified" do
8
+ undefined_return_value.to_s.should include('foo("bar")')
9
+ end
10
+
11
+ it "includes interaction in the error message unknown method called" do
12
+ begin
13
+ undefined_return_value.foobar
14
+ rescue => e
15
+ e.message.should include('foo("bar")')
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bogus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-16 00:00:00.000000000 Z
12
+ date: 2013-07-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dependor
16
- requirement: &70286171254600 !ruby/object:Gem::Requirement
16
+ requirement: &70342181926120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.0.4
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70286171254600
24
+ version_requirements: *70342181926120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70286171253600 !ruby/object:Gem::Requirement
27
+ requirement: &70342181925560 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70286171253600
35
+ version_requirements: *70342181925560
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70286171252600 !ruby/object:Gem::Requirement
38
+ requirement: &70342181924880 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70286171252600
46
+ version_requirements: *70342181924880
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: cucumber
49
- requirement: &70286171267460 !ruby/object:Gem::Requirement
49
+ requirement: &70342182077320 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70286171267460
57
+ version_requirements: *70342182077320
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: aruba
60
- requirement: &70286171266740 !ruby/object:Gem::Requirement
60
+ requirement: &70342182076780 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70286171266740
68
+ version_requirements: *70342182076780
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard
71
- requirement: &70286171265980 !ruby/object:Gem::Requirement
71
+ requirement: &70342182076060 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70286171265980
79
+ version_requirements: *70342182076060
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: guard-rspec
82
- requirement: &70286171265200 !ruby/object:Gem::Requirement
82
+ requirement: &70342182074920 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70286171265200
90
+ version_requirements: *70342182074920
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: guard-cucumber
93
- requirement: &70286171264400 !ruby/object:Gem::Requirement
93
+ requirement: &70342182072800 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70286171264400
101
+ version_requirements: *70342182072800
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: guard-ctags-bundler
104
- requirement: &70286171263940 !ruby/object:Gem::Requirement
104
+ requirement: &70342182071120 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70286171263940
112
+ version_requirements: *70342182071120
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: growl
115
- requirement: &70286171263480 !ruby/object:Gem::Requirement
115
+ requirement: &70342182069000 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70286171263480
123
+ version_requirements: *70342182069000
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: libnotify
126
- requirement: &70286171262780 !ruby/object:Gem::Requirement
126
+ requirement: &70342182066960 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ! '>='
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70286171262780
134
+ version_requirements: *70342182066960
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: rr
137
- requirement: &70286171262040 !ruby/object:Gem::Requirement
137
+ requirement: &70342182065040 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,10 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *70286171262040
145
+ version_requirements: *70342182065040
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: relish
148
- requirement: &70286171261440 !ruby/object:Gem::Requirement
148
+ requirement: &70342182063720 !ruby/object:Gem::Requirement
149
149
  none: false
150
150
  requirements:
151
151
  - - ! '>='
@@ -153,10 +153,10 @@ dependencies:
153
153
  version: '0'
154
154
  type: :development
155
155
  prerelease: false
156
- version_requirements: *70286171261440
156
+ version_requirements: *70342182063720
157
157
  - !ruby/object:Gem::Dependency
158
158
  name: coveralls
159
- requirement: &70286171261020 !ruby/object:Gem::Requirement
159
+ requirement: &70342182062860 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ! '>='
@@ -164,10 +164,10 @@ dependencies:
164
164
  version: '0'
165
165
  type: :development
166
166
  prerelease: false
167
- version_requirements: *70286171261020
167
+ version_requirements: *70342182062860
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: activerecord
170
- requirement: &70286171260500 !ruby/object:Gem::Requirement
170
+ requirement: &70342182061820 !ruby/object:Gem::Requirement
171
171
  none: false
172
172
  requirements:
173
173
  - - ! '>='
@@ -175,10 +175,10 @@ dependencies:
175
175
  version: '0'
176
176
  type: :development
177
177
  prerelease: false
178
- version_requirements: *70286171260500
178
+ version_requirements: *70342182061820
179
179
  - !ruby/object:Gem::Dependency
180
180
  name: activerecord-nulldb-adapter
181
- requirement: &70286171259860 !ruby/object:Gem::Requirement
181
+ requirement: &70342182058360 !ruby/object:Gem::Requirement
182
182
  none: false
183
183
  requirements:
184
184
  - - ! '>='
@@ -186,10 +186,10 @@ dependencies:
186
186
  version: '0'
187
187
  type: :development
188
188
  prerelease: false
189
- version_requirements: *70286171259860
189
+ version_requirements: *70342182058360
190
190
  - !ruby/object:Gem::Dependency
191
191
  name: minitest
192
- requirement: &70286171275160 !ruby/object:Gem::Requirement
192
+ requirement: &70342182054200 !ruby/object:Gem::Requirement
193
193
  none: false
194
194
  requirements:
195
195
  - - ! '>='
@@ -197,7 +197,7 @@ dependencies:
197
197
  version: '4.7'
198
198
  type: :development
199
199
  prerelease: false
200
- version_requirements: *70286171275160
200
+ version_requirements: *70342182054200
201
201
  description: Decreases the need to write integration tests by ensuring that the things
202
202
  you stub or mock actually exist.
203
203
  email:
@@ -225,6 +225,7 @@ files:
225
225
  - features/contract_tests/contract_tests_mocks.feature
226
226
  - features/contract_tests/contract_tests_spies.feature
227
227
  - features/contract_tests/contract_tests_stubs.feature
228
+ - features/contract_tests/custom_overwritten_class.feature
228
229
  - features/contract_tests/readme.md
229
230
  - features/contract_tests/return_value_contracts.feature
230
231
  - features/fakes/anonymous_doubles.feature
@@ -235,7 +236,7 @@ files:
235
236
  - features/fakes/replacing_classes.feature
236
237
  - features/getting_started.md
237
238
  - features/license.md
238
- - features/minitest/minitest_support.feature
239
+ - features/minitest_support.feature
239
240
  - features/readme.md
240
241
  - features/safe_stubbing/argument_matchers.feature
241
242
  - features/safe_stubbing/readme.md
@@ -245,114 +246,124 @@ files:
245
246
  - features/step_definitions/rspec_steps.rb
246
247
  - features/support/env.rb
247
248
  - lib/bogus.rb
248
- - lib/bogus/active_record_accessors.rb
249
- - lib/bogus/adds_recording.rb
250
- - lib/bogus/any_args.rb
251
- - lib/bogus/anything.rb
252
- - lib/bogus/class_methods.rb
253
249
  - lib/bogus/configuration.rb
254
- - lib/bogus/constructor_methods.rb
255
- - lib/bogus/contract_not_fulfilled.rb
256
- - lib/bogus/converts_name_to_class.rb
257
- - lib/bogus/copies_classes.rb
258
- - lib/bogus/copies_methods.rb
259
- - lib/bogus/creates_fakes.rb
260
- - lib/bogus/creates_fakes_with_stubbed_methods.rb
261
- - lib/bogus/default_value.rb
262
- - lib/bogus/double.rb
263
- - lib/bogus/ensures_all_interactions_satisfied.rb
264
- - lib/bogus/fake.rb
250
+ - lib/bogus/contracts/adds_contract_verification.rb
251
+ - lib/bogus/contracts/adds_recording.rb
252
+ - lib/bogus/contracts/contract_not_fulfilled.rb
253
+ - lib/bogus/contracts/interactions_repository.rb
254
+ - lib/bogus/contracts/proxy_class.rb
255
+ - lib/bogus/contracts/recording_proxy.rb
256
+ - lib/bogus/contracts/records_double_interactions.rb
257
+ - lib/bogus/contracts/verifies_contracts.rb
265
258
  - lib/bogus/fake_configuration.rb
266
- - lib/bogus/fake_registry.rb
267
- - lib/bogus/fakes_classes.rb
268
- - lib/bogus/has_overwritten_methods.rb
269
- - lib/bogus/have_received_matcher.rb
259
+ - lib/bogus/fakes/active_record_accessors.rb
260
+ - lib/bogus/fakes/base_class_identifier.rb
261
+ - lib/bogus/fakes/class_methods.rb
262
+ - lib/bogus/fakes/constructor_methods.rb
263
+ - lib/bogus/fakes/converts_name_to_class.rb
264
+ - lib/bogus/fakes/copies_classes.rb
265
+ - lib/bogus/fakes/copies_methods.rb
266
+ - lib/bogus/fakes/creates_fakes.rb
267
+ - lib/bogus/fakes/creates_fakes_with_stubbed_methods.rb
268
+ - lib/bogus/fakes/fake.rb
269
+ - lib/bogus/fakes/fake_registry.rb
270
+ - lib/bogus/fakes/fakes_classes.rb
271
+ - lib/bogus/fakes/instance_methods.rb
272
+ - lib/bogus/fakes/makes_ducks.rb
273
+ - lib/bogus/fakes/makes_substitute_methods.rb
274
+ - lib/bogus/fakes/makes_subtypes.rb
275
+ - lib/bogus/fakes/method_stringifier.rb
276
+ - lib/bogus/fakes/overwriten_classes.rb
277
+ - lib/bogus/fakes/overwrites_classes.rb
278
+ - lib/bogus/fakes/registers_created_fakes.rb
279
+ - lib/bogus/fakes/resets_overwritten_classes.rb
280
+ - lib/bogus/fakes/responds_to_everything.rb
270
281
  - lib/bogus/injector.rb
271
- - lib/bogus/instance_methods.rb
272
- - lib/bogus/interaction.rb
273
- - lib/bogus/interaction_presenter.rb
274
- - lib/bogus/interactions_repository.rb
275
- - lib/bogus/makes_ducks.rb
276
- - lib/bogus/makes_substitute_methods.rb
277
- - lib/bogus/makes_subtypes.rb
278
- - lib/bogus/method_stringifier.rb
279
282
  - lib/bogus/minitest.rb
280
283
  - lib/bogus/minitest/spec.rb
284
+ - lib/bogus/minitest/syntax.rb
281
285
  - lib/bogus/mocking_dsl.rb
282
- - lib/bogus/multi_stubber.rb
283
- - lib/bogus/not_all_expectations_satisfied.rb
284
- - lib/bogus/overwriten_classes.rb
285
- - lib/bogus/overwrites_classes.rb
286
- - lib/bogus/overwrites_methods.rb
287
286
  - lib/bogus/proxies_method_calls.rb
288
- - lib/bogus/proxy_class.rb
289
287
  - lib/bogus/public_methods.rb
290
- - lib/bogus/record_interactions.rb
291
- - lib/bogus/recording_proxy.rb
292
- - lib/bogus/records_double_interactions.rb
293
- - lib/bogus/registers_created_fakes.rb
294
- - lib/bogus/resets_overwritten_classes.rb
295
- - lib/bogus/resets_stubbed_methods.rb
296
- - lib/bogus/responds_to_everything.rb
297
288
  - lib/bogus/rspec.rb
298
- - lib/bogus/rspec_adapter.rb
299
- - lib/bogus/rspec_extensions.rb
300
- - lib/bogus/same_class.rb
301
- - lib/bogus/shadow.rb
289
+ - lib/bogus/rspec/adapter.rb
290
+ - lib/bogus/rspec/extensions.rb
291
+ - lib/bogus/rspec/syntax.rb
292
+ - lib/bogus/stubbing/any_args.rb
293
+ - lib/bogus/stubbing/anything.rb
294
+ - lib/bogus/stubbing/default_value.rb
295
+ - lib/bogus/stubbing/double.rb
296
+ - lib/bogus/stubbing/ensures_all_interactions_satisfied.rb
297
+ - lib/bogus/stubbing/has_overwritten_methods.rb
298
+ - lib/bogus/stubbing/have_received_matcher.rb
299
+ - lib/bogus/stubbing/interaction.rb
300
+ - lib/bogus/stubbing/interaction_presenter.rb
301
+ - lib/bogus/stubbing/multi_stubber.rb
302
+ - lib/bogus/stubbing/not_all_expectations_satisfied.rb
303
+ - lib/bogus/stubbing/overwrites_methods.rb
304
+ - lib/bogus/stubbing/record_interactions.rb
305
+ - lib/bogus/stubbing/resets_stubbed_methods.rb
306
+ - lib/bogus/stubbing/same_class.rb
307
+ - lib/bogus/stubbing/shadow.rb
308
+ - lib/bogus/stubbing/tracks_existence_of_test_doubles.rb
309
+ - lib/bogus/stubbing/undefined_return_value.rb
310
+ - lib/bogus/stubbing/verifies_stub_definition.rb
302
311
  - lib/bogus/takes.rb
303
- - lib/bogus/tracks_existence_of_test_doubles.rb
304
- - lib/bogus/undefined_return_value.rb
305
- - lib/bogus/verifies_contracts.rb
306
- - lib/bogus/verifies_stub_definition.rb
307
312
  - lib/bogus/version.rb
313
+ - license.md
308
314
  - pelusa.sh
309
315
  - rbs.sh
310
- - spec/bogus/adds_recording_spec.rb
311
- - spec/bogus/anything_spec.rb
312
- - spec/bogus/class_methods_spec.rb
313
316
  - spec/bogus/clean_ruby_spec.rb
314
317
  - spec/bogus/configuration_spec.rb
315
- - spec/bogus/converts_name_to_class_spec.rb
316
- - spec/bogus/copies_classes_spec.rb
317
- - spec/bogus/creates_fakes_spec.rb
318
- - spec/bogus/creates_fakes_with_stubbed_methods_spec.rb
319
- - spec/bogus/double_spec.rb
320
- - spec/bogus/ensures_all_interactions_satisfied_spec.rb
321
- - spec/bogus/fake_ar_attributes_spec.rb
322
- - spec/bogus/fake_configuration_spec.rb
323
- - spec/bogus/fake_registry_spec.rb
324
- - spec/bogus/fakes_classes_spec.rb
325
- - spec/bogus/faking_factories_spec.rb
326
- - spec/bogus/frozen_fakes_spec.rb
327
- - spec/bogus/have_received_matcher_spec.rb
328
- - spec/bogus/instance_methods_spec.rb
329
- - spec/bogus/interaction_spec.rb
330
- - spec/bogus/interactions_repository_spec.rb
331
- - spec/bogus/makes_ducks_spec.rb
332
- - spec/bogus/makes_substitute_methods_spec.rb
333
- - spec/bogus/method_copiers_spec.rb
318
+ - spec/bogus/contracts/adds_contract_verification_spec.rb
319
+ - spec/bogus/contracts/adds_recording_spec.rb
320
+ - spec/bogus/contracts/interactions_repository_spec.rb
321
+ - spec/bogus/contracts/proxy_class_spec.rb
322
+ - spec/bogus/contracts/records_double_interactions_spec.rb
323
+ - spec/bogus/contracts/verifies_contracts_spec.rb
324
+ - spec/bogus/fakes/base_class_identifier_spec.rb
325
+ - spec/bogus/fakes/class_methods_spec.rb
326
+ - spec/bogus/fakes/converts_name_to_class_spec.rb
327
+ - spec/bogus/fakes/copies_classes_spec.rb
328
+ - spec/bogus/fakes/creates_fakes_spec.rb
329
+ - spec/bogus/fakes/creates_fakes_with_stubbed_methods_spec.rb
330
+ - spec/bogus/fakes/fake_ar_attributes_spec.rb
331
+ - spec/bogus/fakes/fake_configuration_spec.rb
332
+ - spec/bogus/fakes/fake_registry_spec.rb
333
+ - spec/bogus/fakes/fake_spec.rb
334
+ - spec/bogus/fakes/fakes_classes_spec.rb
335
+ - spec/bogus/fakes/faking_factories_spec.rb
336
+ - spec/bogus/fakes/frozen_fakes_spec.rb
337
+ - spec/bogus/fakes/instance_methods_spec.rb
338
+ - spec/bogus/fakes/makes_ducks_spec.rb
339
+ - spec/bogus/fakes/makes_substitute_methods_spec.rb
340
+ - spec/bogus/fakes/method_copiers_spec.rb
341
+ - spec/bogus/fakes/overwriten_classes_spec.rb
342
+ - spec/bogus/fakes/overwrites_classes_spec.rb
343
+ - spec/bogus/fakes/registers_created_fakes_spec.rb
344
+ - spec/bogus/fakes/resets_overwritten_classes_spec.rb
334
345
  - spec/bogus/mocking_dsl_spec.rb
335
- - spec/bogus/multi_stubber_spec.rb
336
- - spec/bogus/overwriten_classes_spec.rb
337
- - spec/bogus/overwrites_classes_spec.rb
338
- - spec/bogus/overwrites_methods_spec.rb
339
- - spec/bogus/proxy_class_spec.rb
340
- - spec/bogus/record_interactions_spec.rb
341
- - spec/bogus/records_double_interactions_spec.rb
342
- - spec/bogus/registers_created_fakes_spec.rb
343
- - spec/bogus/resets_overwritten_classes_spec.rb
344
- - spec/bogus/resets_stubbed_methods_spec.rb
345
346
  - spec/bogus/ruby_2_support_spec.rb
346
- - spec/bogus/shadow_spec.rb
347
- - spec/bogus/tracks_existence_of_test_doubles_spec.rb
348
- - spec/bogus/verifies_contracts_spec.rb
349
- - spec/bogus/verifies_stub_definition_spec.rb
347
+ - spec/bogus/stubbing/anything_spec.rb
348
+ - spec/bogus/stubbing/double_spec.rb
349
+ - spec/bogus/stubbing/ensures_all_interactions_satisfied_spec.rb
350
+ - spec/bogus/stubbing/have_received_matcher_spec.rb
351
+ - spec/bogus/stubbing/interaction_spec.rb
352
+ - spec/bogus/stubbing/multi_stubber_spec.rb
353
+ - spec/bogus/stubbing/overwrites_methods_spec.rb
354
+ - spec/bogus/stubbing/record_interactions_spec.rb
355
+ - spec/bogus/stubbing/resets_stubbed_methods_spec.rb
356
+ - spec/bogus/stubbing/shadow_spec.rb
357
+ - spec/bogus/stubbing/tracks_existence_of_test_doubles_spec.rb
358
+ - spec/bogus/stubbing/undefined_return_value_spec.rb
359
+ - spec/bogus/stubbing/verifies_stub_definition_spec.rb
350
360
  - spec/spec_helper.rb
351
361
  - spec/support/fake_creator_of_fakes.rb
352
362
  - spec/support/matchers.rb
353
363
  - spec/support/sample_fake.rb
354
364
  homepage: https://github.com/psyho/bogus
355
- licenses: []
365
+ licenses:
366
+ - MIT
356
367
  post_install_message:
357
368
  rdoc_options: []
358
369
  require_paths:
@@ -384,6 +395,7 @@ test_files:
384
395
  - features/contract_tests/contract_tests_mocks.feature
385
396
  - features/contract_tests/contract_tests_spies.feature
386
397
  - features/contract_tests/contract_tests_stubs.feature
398
+ - features/contract_tests/custom_overwritten_class.feature
387
399
  - features/contract_tests/readme.md
388
400
  - features/contract_tests/return_value_contracts.feature
389
401
  - features/fakes/anonymous_doubles.feature
@@ -394,7 +406,7 @@ test_files:
394
406
  - features/fakes/replacing_classes.feature
395
407
  - features/getting_started.md
396
408
  - features/license.md
397
- - features/minitest/minitest_support.feature
409
+ - features/minitest_support.feature
398
410
  - features/readme.md
399
411
  - features/safe_stubbing/argument_matchers.feature
400
412
  - features/safe_stubbing/readme.md
@@ -403,46 +415,50 @@ test_files:
403
415
  - features/safe_stubbing/spies.feature
404
416
  - features/step_definitions/rspec_steps.rb
405
417
  - features/support/env.rb
406
- - spec/bogus/adds_recording_spec.rb
407
- - spec/bogus/anything_spec.rb
408
- - spec/bogus/class_methods_spec.rb
409
418
  - spec/bogus/clean_ruby_spec.rb
410
419
  - spec/bogus/configuration_spec.rb
411
- - spec/bogus/converts_name_to_class_spec.rb
412
- - spec/bogus/copies_classes_spec.rb
413
- - spec/bogus/creates_fakes_spec.rb
414
- - spec/bogus/creates_fakes_with_stubbed_methods_spec.rb
415
- - spec/bogus/double_spec.rb
416
- - spec/bogus/ensures_all_interactions_satisfied_spec.rb
417
- - spec/bogus/fake_ar_attributes_spec.rb
418
- - spec/bogus/fake_configuration_spec.rb
419
- - spec/bogus/fake_registry_spec.rb
420
- - spec/bogus/fakes_classes_spec.rb
421
- - spec/bogus/faking_factories_spec.rb
422
- - spec/bogus/frozen_fakes_spec.rb
423
- - spec/bogus/have_received_matcher_spec.rb
424
- - spec/bogus/instance_methods_spec.rb
425
- - spec/bogus/interaction_spec.rb
426
- - spec/bogus/interactions_repository_spec.rb
427
- - spec/bogus/makes_ducks_spec.rb
428
- - spec/bogus/makes_substitute_methods_spec.rb
429
- - spec/bogus/method_copiers_spec.rb
420
+ - spec/bogus/contracts/adds_contract_verification_spec.rb
421
+ - spec/bogus/contracts/adds_recording_spec.rb
422
+ - spec/bogus/contracts/interactions_repository_spec.rb
423
+ - spec/bogus/contracts/proxy_class_spec.rb
424
+ - spec/bogus/contracts/records_double_interactions_spec.rb
425
+ - spec/bogus/contracts/verifies_contracts_spec.rb
426
+ - spec/bogus/fakes/base_class_identifier_spec.rb
427
+ - spec/bogus/fakes/class_methods_spec.rb
428
+ - spec/bogus/fakes/converts_name_to_class_spec.rb
429
+ - spec/bogus/fakes/copies_classes_spec.rb
430
+ - spec/bogus/fakes/creates_fakes_spec.rb
431
+ - spec/bogus/fakes/creates_fakes_with_stubbed_methods_spec.rb
432
+ - spec/bogus/fakes/fake_ar_attributes_spec.rb
433
+ - spec/bogus/fakes/fake_configuration_spec.rb
434
+ - spec/bogus/fakes/fake_registry_spec.rb
435
+ - spec/bogus/fakes/fake_spec.rb
436
+ - spec/bogus/fakes/fakes_classes_spec.rb
437
+ - spec/bogus/fakes/faking_factories_spec.rb
438
+ - spec/bogus/fakes/frozen_fakes_spec.rb
439
+ - spec/bogus/fakes/instance_methods_spec.rb
440
+ - spec/bogus/fakes/makes_ducks_spec.rb
441
+ - spec/bogus/fakes/makes_substitute_methods_spec.rb
442
+ - spec/bogus/fakes/method_copiers_spec.rb
443
+ - spec/bogus/fakes/overwriten_classes_spec.rb
444
+ - spec/bogus/fakes/overwrites_classes_spec.rb
445
+ - spec/bogus/fakes/registers_created_fakes_spec.rb
446
+ - spec/bogus/fakes/resets_overwritten_classes_spec.rb
430
447
  - spec/bogus/mocking_dsl_spec.rb
431
- - spec/bogus/multi_stubber_spec.rb
432
- - spec/bogus/overwriten_classes_spec.rb
433
- - spec/bogus/overwrites_classes_spec.rb
434
- - spec/bogus/overwrites_methods_spec.rb
435
- - spec/bogus/proxy_class_spec.rb
436
- - spec/bogus/record_interactions_spec.rb
437
- - spec/bogus/records_double_interactions_spec.rb
438
- - spec/bogus/registers_created_fakes_spec.rb
439
- - spec/bogus/resets_overwritten_classes_spec.rb
440
- - spec/bogus/resets_stubbed_methods_spec.rb
441
448
  - spec/bogus/ruby_2_support_spec.rb
442
- - spec/bogus/shadow_spec.rb
443
- - spec/bogus/tracks_existence_of_test_doubles_spec.rb
444
- - spec/bogus/verifies_contracts_spec.rb
445
- - spec/bogus/verifies_stub_definition_spec.rb
449
+ - spec/bogus/stubbing/anything_spec.rb
450
+ - spec/bogus/stubbing/double_spec.rb
451
+ - spec/bogus/stubbing/ensures_all_interactions_satisfied_spec.rb
452
+ - spec/bogus/stubbing/have_received_matcher_spec.rb
453
+ - spec/bogus/stubbing/interaction_spec.rb
454
+ - spec/bogus/stubbing/multi_stubber_spec.rb
455
+ - spec/bogus/stubbing/overwrites_methods_spec.rb
456
+ - spec/bogus/stubbing/record_interactions_spec.rb
457
+ - spec/bogus/stubbing/resets_stubbed_methods_spec.rb
458
+ - spec/bogus/stubbing/shadow_spec.rb
459
+ - spec/bogus/stubbing/tracks_existence_of_test_doubles_spec.rb
460
+ - spec/bogus/stubbing/undefined_return_value_spec.rb
461
+ - spec/bogus/stubbing/verifies_stub_definition_spec.rb
446
462
  - spec/spec_helper.rb
447
463
  - spec/support/fake_creator_of_fakes.rb
448
464
  - spec/support/matchers.rb