bogus 0.0.2 → 0.0.3.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Gemfile.lock +14 -2
- data/Guardfile +5 -0
- data/README.md +7 -249
- data/bogus.gemspec +3 -1
- data/features/.nav +21 -0
- data/features/authors.md +42 -0
- data/{CHANGELOG.md → features/changelog.md} +9 -2
- data/features/configuration_options.feature +1 -2
- data/features/{contract_tests_mocks.feature → contract_tests/contract_tests_mocks.feature} +4 -1
- data/features/{contract_tests_spies.feature → contract_tests/contract_tests_spies.feature} +2 -0
- data/features/{contract_tests_stubs.feature → contract_tests/contract_tests_stubs.feature} +14 -0
- data/features/contract_tests/readme.md +26 -0
- data/features/{return_value_contracts.feature → contract_tests/return_value_contracts.feature} +6 -2
- data/features/{anonymous_doubles.feature → fakes/anonymous_doubles.feature} +24 -8
- data/features/{fake_objects.feature → fakes/fake_objects.feature} +39 -4
- data/features/fakes/global_fake_configuration.feature +88 -0
- data/features/fakes/readme.md +11 -0
- data/features/fakes/replacing_classes.feature +148 -0
- data/features/getting_started.md +36 -0
- data/features/license.md +9 -0
- data/features/readme.md +173 -0
- data/features/safe_stubbing/argument_matchers.feature +30 -0
- data/features/safe_stubbing/readme.md +35 -0
- data/features/{safe_mocking.feature → safe_stubbing/safe_mocking.feature} +14 -0
- data/features/{safe_stubbing.feature → safe_stubbing/safe_stubbing.feature} +18 -4
- data/features/{spies.feature → safe_stubbing/spies.feature} +19 -4
- data/features/step_definitions/rspec_steps.rb +14 -5
- data/features/support/env.rb +4 -0
- data/lib/bogus.rb +2 -0
- data/lib/bogus/adds_recording.rb +11 -7
- data/lib/bogus/any_args.rb +7 -0
- data/lib/bogus/anything.rb +11 -0
- data/lib/bogus/contract_not_fulfilled.rb +17 -10
- data/lib/bogus/copies_classes.rb +2 -6
- data/lib/bogus/creates_fakes_with_stubbed_methods.rb +40 -0
- data/lib/bogus/double.rb +28 -8
- data/lib/bogus/ensures_all_interactions_satisfied.rb +36 -0
- data/lib/bogus/fake.rb +6 -0
- data/lib/bogus/fake_configuration.rb +69 -0
- data/lib/bogus/fakes_classes.rb +21 -0
- data/lib/bogus/has_overwritten_methods.rb +24 -0
- data/lib/bogus/have_received_matcher.rb +63 -0
- data/lib/bogus/injector.rb +36 -14
- data/lib/bogus/interaction.rb +33 -17
- data/lib/bogus/makes_substitute_methods.rb +15 -0
- data/lib/bogus/mocking_dsl.rb +31 -0
- data/lib/bogus/multi_stubber.rb +15 -0
- data/lib/bogus/not_all_expectations_satisfied.rb +27 -0
- data/lib/bogus/overwriten_classes.rb +15 -0
- data/lib/bogus/overwrites_classes.rb +2 -2
- data/lib/bogus/overwrites_methods.rb +42 -0
- data/lib/bogus/proxies_method_calls.rb +23 -0
- data/lib/bogus/proxy_class.rb +25 -16
- data/lib/bogus/public_methods.rb +36 -11
- data/lib/bogus/record_interactions.rb +3 -9
- data/lib/bogus/recording_proxy.rb +5 -0
- data/lib/bogus/registers_created_fakes.rb +2 -1
- data/lib/bogus/resets_overwritten_classes.rb +14 -0
- data/lib/bogus/resets_stubbed_methods.rb +12 -0
- data/lib/bogus/responds_to_everything.rb +11 -0
- data/lib/bogus/rspec.rb +7 -0
- data/lib/bogus/rspec_adapter.rb +17 -0
- data/lib/bogus/rspec_extensions.rb +8 -20
- data/lib/bogus/shadow.rb +60 -0
- data/lib/bogus/verifies_contracts.rb +5 -1
- data/lib/bogus/verifies_stub_definition.rb +5 -0
- data/lib/bogus/version.rb +1 -1
- data/lib/tracks_existence_of_test_doubles.rb +11 -0
- data/spec/bogus/adds_recording_spec.rb +46 -10
- data/spec/bogus/anything_spec.rb +13 -0
- data/spec/bogus/copies_classes_spec.rb +4 -3
- data/spec/bogus/creates_fakes_with_stubbed_methods_spec.rb +121 -0
- data/spec/bogus/double_spec.rb +63 -20
- data/spec/bogus/ensures_all_interactions_satisfied_spec.rb +43 -0
- data/spec/bogus/fake_configuration_spec.rb +99 -0
- data/spec/bogus/fakes_classes_spec.rb +46 -0
- data/spec/bogus/have_received_matcher_spec.rb +56 -0
- data/spec/bogus/interaction_spec.rb +18 -7
- data/spec/bogus/interactions_repository_spec.rb +42 -0
- data/spec/bogus/makes_substitute_methods_spec.rb +24 -0
- data/spec/bogus/mocking_dsl_spec.rb +234 -7
- data/spec/bogus/multi_stubber_spec.rb +31 -0
- data/spec/bogus/overwriten_classes_spec.rb +27 -0
- data/spec/bogus/overwrites_classes_spec.rb +2 -2
- data/spec/bogus/overwrites_methods_spec.rb +107 -0
- data/spec/bogus/proxy_class_spec.rb +6 -0
- data/spec/bogus/record_interactions_spec.rb +3 -4
- data/spec/bogus/registers_created_fakes_spec.rb +8 -0
- data/spec/bogus/resets_overwritten_classes_spec.rb +26 -0
- data/spec/bogus/resets_stubbed_methods_spec.rb +16 -0
- data/spec/bogus/shadow_spec.rb +182 -0
- data/spec/bogus/verifies_contracts_spec.rb +9 -3
- data/spec/bogus/verifies_stub_definition_spec.rb +4 -0
- data/spec/spec_helper.rb +3 -0
- data/spec/support/fake_creator_of_fakes.rb +15 -0
- data/spec/support/sample_fake.rb +13 -0
- data/spec/tracks_existence_of_test_doubles_spec.rb +26 -0
- metadata +105 -32
- data/lib/bogus/creates_anonymous_stubs.rb +0 -27
- data/lib/bogus/invocation_matcher.rb +0 -27
- data/lib/bogus/rr_proxy.rb +0 -5
- data/spec/bogus/invocation_matcher_spec.rb +0 -26
data/lib/bogus/rr_proxy.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Bogus::InvocationMatcher do
|
4
|
-
let(:object) { stub }
|
5
|
-
let(:method) { nil }
|
6
|
-
let(:records_double_interactions) { stub }
|
7
|
-
let(:verifies_stub_definition) { stub }
|
8
|
-
|
9
|
-
let(:invocation_matcher) { isolate(Bogus::InvocationMatcher) }
|
10
|
-
|
11
|
-
before do
|
12
|
-
stub(verifies_stub_definition).verify!
|
13
|
-
stub(records_double_interactions).record
|
14
|
-
|
15
|
-
invocation_matcher.the_method(:foo, :bar)
|
16
|
-
invocation_matcher.matches?(object)
|
17
|
-
end
|
18
|
-
|
19
|
-
it "verifies stub definition" do
|
20
|
-
verifies_stub_definition.should have_received.verify!(object, :the_method, [:foo, :bar])
|
21
|
-
end
|
22
|
-
|
23
|
-
it "records double interacions" do
|
24
|
-
records_double_interactions.should have_received.record(object, :the_method, [:foo, :bar])
|
25
|
-
end
|
26
|
-
end
|