bogus 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.travis.yml +1 -1
  4. data/Guardfile +1 -3
  5. data/Guardfile.cucumber +0 -2
  6. data/README.md +1 -1
  7. data/bogus.gemspec +3 -1
  8. data/features/changelog.md +11 -0
  9. data/features/configuration/fake_ar_attributes.feature +2 -2
  10. data/features/contract_tests/contract_tests_mocks.feature +5 -5
  11. data/features/contract_tests/contract_tests_spies.feature +1 -1
  12. data/features/contract_tests/contract_tests_stubs.feature +6 -6
  13. data/features/contract_tests/custom_overwritten_class.feature +4 -4
  14. data/features/contract_tests/return_value_contracts.feature +2 -2
  15. data/features/fakes/anonymous_doubles.feature +5 -5
  16. data/features/fakes/duck_types.feature +9 -9
  17. data/features/fakes/fake_objects.feature +31 -8
  18. data/features/fakes/global_fake_configuration.feature +5 -5
  19. data/features/fakes/replacing_classes.feature +5 -5
  20. data/features/readme.md +5 -5
  21. data/features/safe_stubbing/argument_matchers.feature +23 -10
  22. data/features/safe_stubbing/safe_mocking.feature +1 -1
  23. data/features/safe_stubbing/safe_stubbing.feature +1 -1
  24. data/features/safe_stubbing/spies.feature +7 -7
  25. data/lib/bogus.rb +1 -0
  26. data/lib/bogus/core_ext.rb +22 -0
  27. data/lib/bogus/fakes/fake.rb +2 -1
  28. data/lib/bogus/fakes/method_stringifier.rb +1 -0
  29. data/lib/bogus/mocking_dsl.rb +4 -0
  30. data/lib/bogus/stubbing/has_overwritten_methods.rb +28 -10
  31. data/lib/bogus/stubbing/have_received_matcher.rb +4 -2
  32. data/lib/bogus/stubbing/matchers/any_args.rb +9 -0
  33. data/lib/bogus/stubbing/matchers/matches_argument.rb +11 -0
  34. data/lib/bogus/stubbing/{any_args.rb → matchers/with_arguments.rb} +0 -6
  35. data/lib/bogus/stubbing/overwrites_methods.rb +6 -1
  36. data/lib/bogus/stubbing/undefined_return_value.rb +4 -0
  37. data/lib/bogus/support.rb +11 -0
  38. data/lib/bogus/version.rb +1 -1
  39. data/spec/bogus/clean_ruby_spec.rb +1 -1
  40. data/spec/bogus/configuration_spec.rb +2 -2
  41. data/spec/bogus/contracts/adds_contract_verification_spec.rb +10 -10
  42. data/spec/bogus/contracts/adds_recording_spec.rb +4 -4
  43. data/spec/bogus/contracts/interactions_repository_spec.rb +15 -15
  44. data/spec/bogus/contracts/proxy_class_spec.rb +7 -7
  45. data/spec/bogus/contracts/records_double_interactions_spec.rb +1 -1
  46. data/spec/bogus/contracts/verifies_contracts_spec.rb +3 -3
  47. data/spec/bogus/fakes/base_class_identifier_spec.rb +1 -1
  48. data/spec/bogus/fakes/class_methods_spec.rb +4 -5
  49. data/spec/bogus/fakes/converts_name_to_class_spec.rb +3 -3
  50. data/spec/bogus/fakes/copies_classes_spec.rb +20 -16
  51. data/spec/bogus/fakes/creates_fakes_spec.rb +6 -6
  52. data/spec/bogus/fakes/creates_fakes_with_stubbed_methods_spec.rb +16 -15
  53. data/spec/bogus/fakes/fake_ar_attributes_spec.rb +3 -3
  54. data/spec/bogus/fakes/fake_configuration_spec.rb +16 -16
  55. data/spec/bogus/fakes/fake_registry_spec.rb +2 -2
  56. data/spec/bogus/fakes/fake_spec.rb +1 -1
  57. data/spec/bogus/fakes/fakes_classes_spec.rb +4 -4
  58. data/spec/bogus/fakes/faking_factories_spec.rb +4 -4
  59. data/spec/bogus/fakes/frozen_fakes_spec.rb +4 -4
  60. data/spec/bogus/fakes/instance_methods_spec.rb +5 -5
  61. data/spec/bogus/fakes/makes_ducks_spec.rb +3 -3
  62. data/spec/bogus/fakes/makes_substitute_methods_spec.rb +1 -1
  63. data/spec/bogus/fakes/overwriten_classes_spec.rb +3 -3
  64. data/spec/bogus/fakes/overwrites_classes_spec.rb +2 -2
  65. data/spec/bogus/fakes/registers_created_fakes_spec.rb +3 -3
  66. data/spec/bogus/fakes/resets_overwritten_classes_spec.rb +3 -3
  67. data/spec/bogus/fakes/stubbing_new_method_on_fake_class_spec.rb +25 -0
  68. data/spec/bogus/mocking_dsl_spec.rb +36 -36
  69. data/spec/bogus/ruby_2_1_support_spec.rb +38 -0
  70. data/spec/bogus/ruby_2_support_spec.rb +14 -64
  71. data/spec/bogus/stubbing/anything_spec.rb +5 -5
  72. data/spec/bogus/stubbing/double_spec.rb +2 -2
  73. data/spec/bogus/stubbing/have_received_matcher_spec.rb +11 -6
  74. data/spec/bogus/stubbing/interaction_spec.rb +7 -7
  75. data/spec/bogus/stubbing/multi_stubber_spec.rb +2 -2
  76. data/spec/bogus/stubbing/overwrites_methods_spec.rb +8 -8
  77. data/spec/bogus/stubbing/record_interactions_spec.rb +3 -3
  78. data/spec/bogus/stubbing/shadow_spec.rb +28 -28
  79. data/spec/bogus/stubbing/stubbing_existing_methods_on_fakes_spec.rb +50 -0
  80. data/spec/bogus/stubbing/tracks_existence_of_test_doubles_spec.rb +2 -2
  81. data/spec/bogus/stubbing/undefined_return_value_spec.rb +2 -2
  82. data/spec/spec_helper.rb +6 -1
  83. data/spec/support/shared_examples_for_keyword_arguments.rb +63 -0
  84. metadata +160 -160
  85. data/Gemfile.lock +0 -146
@@ -8,10 +8,10 @@ describe Bogus::Configuration do
8
8
  c.search_modules << String
9
9
  end
10
10
 
11
- Bogus.config.search_modules.should == [Object, String]
11
+ expect(Bogus.config.search_modules).to eq [Object, String]
12
12
  end
13
13
 
14
14
  it "defaults search_modules to [Object]" do
15
- Bogus.config.search_modules.should == [Object]
15
+ expect(Bogus.config.search_modules).to eq [Object]
16
16
  end
17
17
  end
@@ -37,7 +37,7 @@ describe Bogus::AddsContractVerification do
37
37
  it "verifies the contract in after_suite" do
38
38
  syntax.run_after_suite
39
39
 
40
- verifies_contracts.should have_received.verify(:some_fake)
40
+ expect(verifies_contracts).to have_received.verify(:some_fake)
41
41
  end
42
42
  end
43
43
 
@@ -72,14 +72,14 @@ describe Bogus::AddsContractVerification do
72
72
  it "overwrites described_class in before" do
73
73
  syntax.run_before
74
74
 
75
- syntax.described_class.should == overwritten_class
75
+ expect(syntax.described_class).to eq overwritten_class
76
76
  end
77
77
 
78
78
  it "resets described_class in after" do
79
79
  syntax.run_before
80
80
  syntax.run_after
81
81
 
82
- syntax.described_class.should == SomeClass
82
+ expect(syntax.described_class).to eq SomeClass
83
83
  end
84
84
 
85
85
  it_verifies_contract_after_suite
@@ -87,7 +87,7 @@ describe Bogus::AddsContractVerification do
87
87
  it "adds recording to described_class" do
88
88
  syntax.run_before
89
89
 
90
- adds_recording.should have_received.add(:some_fake, SomeClass)
90
+ expect(adds_recording).to have_received.add(:some_fake, SomeClass)
91
91
  end
92
92
  end
93
93
 
@@ -104,14 +104,14 @@ describe Bogus::AddsContractVerification do
104
104
  it "does not overwrite described_class in before" do
105
105
  syntax.run_before
106
106
 
107
- syntax.described_class.should == SomeClass
107
+ expect(syntax.described_class).to eq SomeClass
108
108
  end
109
109
 
110
110
  it "does not change described_class in after" do
111
111
  syntax.run_before
112
112
  syntax.run_after
113
113
 
114
- syntax.described_class.should == SomeClass
114
+ expect(syntax.described_class).to eq SomeClass
115
115
  end
116
116
 
117
117
  it_verifies_contract_after_suite
@@ -119,7 +119,7 @@ describe Bogus::AddsContractVerification do
119
119
  it "adds recording to custom class" do
120
120
  syntax.run_before
121
121
 
122
- adds_recording.should have_received.add(:some_fake, ClassToOverwrite)
122
+ expect(adds_recording).to have_received.add(:some_fake, ClassToOverwrite)
123
123
  end
124
124
  end
125
125
 
@@ -133,14 +133,14 @@ describe Bogus::AddsContractVerification do
133
133
  it "does not overwrite described_class in before" do
134
134
  syntax.run_before
135
135
 
136
- syntax.described_class.should be_nil
136
+ expect(syntax.described_class).to be_nil
137
137
  end
138
138
 
139
139
  it "does not change described_class in after" do
140
140
  syntax.run_before
141
141
  syntax.run_after
142
142
 
143
- syntax.described_class.should be_nil
143
+ expect(syntax.described_class).to be_nil
144
144
  end
145
145
 
146
146
  it_verifies_contract_after_suite
@@ -148,7 +148,7 @@ describe Bogus::AddsContractVerification do
148
148
  it "adds recording to class based on fake name" do
149
149
  syntax.run_before
150
150
 
151
- adds_recording.should have_received.add(:some_fake, ClassGuessedFromFakeName)
151
+ expect(adds_recording).to have_received.add(:some_fake, ClassGuessedFromFakeName)
152
152
  end
153
153
  end
154
154
  end
@@ -26,18 +26,18 @@ describe Bogus::AddsRecording do
26
26
  end
27
27
 
28
28
  it "creates the proxy" do
29
- create_proxy_class.should have_received.call(:library, SampleModule::Library)
29
+ expect(create_proxy_class).to have_received.call(:library, SampleModule::Library)
30
30
  end
31
31
 
32
32
  it "swaps the classes" do
33
- overwrites_classes.should have_received.overwrite('SampleModule::Library', Object)
33
+ expect(overwrites_classes).to have_received.overwrite('SampleModule::Library', Object)
34
34
  end
35
35
 
36
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)
37
+ expect(overwritten_classes).to have_received.add("SampleModule::Library", SampleModule::Library)
38
38
  end
39
39
 
40
40
  it "returns the proxy class" do
41
- adds_recording.add(:library, SampleModule::Library).should == Object
41
+ expect(adds_recording.add(:library, SampleModule::Library)).to eq Object
42
42
  end
43
43
  end
@@ -10,80 +10,80 @@ describe Bogus::InteractionsRepository do
10
10
  it "considers the interaction recorded if it was recorded previously" do
11
11
  interactions_repository.record(:foo, :bar, 1, 2, 3)
12
12
 
13
- recorded?(:foo, :bar, 1, 2, 3).should be_true
13
+ expect(recorded?(:foo, :bar, 1, 2, 3)).to be_true
14
14
  end
15
15
 
16
16
  it "considers the interaction recorded if it returned the same value as passed block" do
17
17
  interactions_repository.record(:foo, :bar) { "a result" }
18
18
  interaction = Bogus::Interaction.new(:bar, []) { "a result" }
19
19
 
20
- interactions_repository.recorded?(:foo, interaction).should be_true
20
+ expect(interactions_repository.recorded?(:foo, interaction)).to be_true
21
21
  end
22
22
 
23
23
  it "does not consider any interactions recorded prior to any recordings" do
24
- recorded?(:foo, :bar, 1).should be_false
24
+ expect(recorded?(:foo, :bar, 1)).to be_false
25
25
  end
26
26
 
27
27
  it "does not consider the interaction recorded with a different fake name" do
28
28
  interactions_repository.record(:baz, :bar, 1)
29
29
 
30
- recorded?(:foo, :bar, 1).should be_false
30
+ expect(recorded?(:foo, :bar, 1)).to be_false
31
31
  end
32
32
 
33
33
  it "does not consider the interaction recorded with a different method name" do
34
34
  interactions_repository.record(:foo, :baz, 1)
35
35
 
36
- recorded?(:foo, :bar, 1).should be_false
36
+ expect(recorded?(:foo, :bar, 1)).to be_false
37
37
  end
38
38
 
39
39
  it "does not consider the interaction recorded with different method arguments" do
40
40
  interactions_repository.record(:foo, :bar, 1, 2)
41
41
 
42
- recorded?(:foo, :bar, 1).should be_false
42
+ expect(recorded?(:foo, :bar, 1)).to be_false
43
43
  end
44
44
 
45
45
  it "returns a list of interactions for given fake" do
46
46
  interactions_repository.record(:foo, :bar, 1, 2)
47
47
 
48
48
  interactions = interactions_repository.for_fake(:foo)
49
- interactions.should have(1).item
50
- interactions.first.method.should == :bar
51
- interactions.first.args.should == [1, 2]
49
+ expect(interactions).to have(1).item
50
+ expect(interactions.first.method).to eq :bar
51
+ expect(interactions.first.args).to eq [1, 2]
52
52
  end
53
53
 
54
54
  it "ignores arguments if the checked interaction has any_args" do
55
55
  interactions_repository.record(:foo, :bar, 1)
56
56
 
57
- recorded?(:foo, :bar, Bogus::AnyArgs).should be_true
57
+ expect(recorded?(:foo, :bar, Bogus::AnyArgs)).to be_true
58
58
  end
59
59
 
60
60
  it "takes method name into account when matching interaction with wildcard arguments" do
61
61
  interactions_repository.record(:foo, :baz, 1)
62
62
 
63
- recorded?(:foo, :bar, Bogus::AnyArgs).should be_false
63
+ expect(recorded?(:foo, :bar, Bogus::AnyArgs)).to be_false
64
64
  end
65
65
 
66
66
  it "ignores arguments if the recorded interaction was recorded with wildcard argument" do
67
67
  interactions_repository.record(:foo, :bar, 1, 2)
68
68
 
69
- recorded?(:foo, :bar, 1, Bogus::Anything).should be_true
69
+ expect(recorded?(:foo, :bar, 1, Bogus::Anything)).to be_true
70
70
  end
71
71
 
72
72
  it "takes other arguments into account when matching interactions with wildcards" do
73
73
  interactions_repository.record(:foo, :bar, 1, 2)
74
74
 
75
- recorded?(:foo, :bar, 2, Bogus::Anything).should be_false
75
+ expect(recorded?(:foo, :bar, 2, Bogus::Anything)).to be_false
76
76
  end
77
77
 
78
78
  it "ignores arguments if the checked interaction has any_args" do
79
79
  interactions_repository.record(:foo, :bar, 1, 2)
80
80
 
81
- recorded?(:foo, :bar, 1, Bogus::Anything).should be_true
81
+ expect(recorded?(:foo, :bar, 1, Bogus::Anything)).to be_true
82
82
  end
83
83
 
84
84
  it "takes method name into account when matching interaction with wildcard arguments" do
85
85
  interactions_repository.record(:foo, :baz, 1, 2)
86
86
 
87
- recorded?(:foo, :bar, 1, Bogus::Anything).should be_false
87
+ expect(recorded?(:foo, :bar, 1, Bogus::Anything)).to be_false
88
88
  end
89
89
  end
@@ -28,33 +28,33 @@ describe Bogus::ProxyClass do
28
28
  let(:interactions_repository) { FakeRepository.new }
29
29
 
30
30
  it "returns the proxy" do
31
- proxy_class.new.checkout("Moby Dick", "Bob").should == :checkouted
31
+ expect(proxy_class.new.checkout("Moby Dick", "Bob")).to eq :checkouted
32
32
  end
33
33
 
34
34
  it "records interactions with created objects" do
35
35
  proxy_class.new.checkout("Moby Dick", "Bob")
36
36
 
37
- interactions_repository.should have_recorded(:fake_name, :checkout, "Moby Dick", "Bob")
37
+ expect(interactions_repository).to have_recorded(:fake_name, :checkout, "Moby Dick", "Bob")
38
38
  end
39
39
 
40
40
  it "responds to every method that the original class responds to" do
41
- proxy_class.should respond_to(:find_by_address)
41
+ expect(proxy_class).to respond_to(:find_by_address)
42
42
  end
43
43
 
44
44
  it "delegates interactions with the proxy class to wrapped class" do
45
- proxy_class.find_by_address("some address").should == :the_library
45
+ expect(proxy_class.find_by_address("some address")).to eq :the_library
46
46
  end
47
47
 
48
48
  it "records interactions with the proxy class" do
49
49
  proxy_class.find_by_address("some address")
50
50
 
51
- interactions_repository.should have_recorded(:fake_name, :find_by_address, "some address")
51
+ expect(interactions_repository).to have_recorded(:fake_name, :find_by_address, "some address")
52
52
  end
53
53
 
54
54
  it "records return values" do
55
55
  proxy_class.find_by_address("some address")
56
56
 
57
- interactions_repository.return_value(:fake_name, :find_by_address, "some address").should == :the_library
57
+ expect(interactions_repository.return_value(:fake_name, :find_by_address, "some address")).to eq :the_library
58
58
  end
59
59
 
60
60
  it "re-raises exceptions" do
@@ -72,7 +72,7 @@ describe Bogus::ProxyClass do
72
72
  end
73
73
 
74
74
  it "allows accessing the constants defined on proxied class" do
75
- proxy_class::SAMPLE_CONSTANT.should == "foo"
75
+ expect(proxy_class::SAMPLE_CONSTANT).to eq "foo"
76
76
  end
77
77
 
78
78
  class FakeRepository
@@ -13,7 +13,7 @@ describe Bogus::RecordsDoubleInteractions do
13
13
 
14
14
  records_double_interactions.record(object, :method_name, [:foo, 1])
15
15
 
16
- doubled_interactions.should have_received.record(:object_name, :method_name, :foo, 1)
16
+ expect(doubled_interactions).to have_received.record(:object_name, :method_name, :foo, 1)
17
17
  end
18
18
 
19
19
  it "does not record the interaction if object is not a fake" do
@@ -37,9 +37,9 @@ describe Bogus::VerifiesContracts do
37
37
  verifies_contracts.verify(name)
38
38
  fail
39
39
  rescue Bogus::ContractNotFulfilled => contract_error
40
- contract_error.fake_name.should == name
41
- contract_error.missed_interactions.should == missed
42
- contract_error.actual_interactions.should == real
40
+ expect(contract_error.fake_name).to eq name
41
+ expect(contract_error.missed_interactions).to eq missed
42
+ expect(contract_error.actual_interactions).to eq real
43
43
  end
44
44
 
45
45
  def interaction(method)
@@ -45,7 +45,7 @@ module SampleForBaseIdentifier
45
45
  it "returns the same for is_a?(#{klass})" do
46
46
  expected = instance.is_a?(klass)
47
47
  actual = Bogus::BaseClassIdentifier.base_class?(copied_class, klass)
48
- actual.should == expected
48
+ expect(actual).to eq expected
49
49
  end
50
50
  end
51
51
  end
@@ -22,18 +22,17 @@ module Bogus
22
22
  let(:class_methods) { ClassMethods.new(SampleClass) }
23
23
 
24
24
  it "lists the class methods excluding the ones added by Bogus" do
25
- class_methods.all.should =~ [:bar, :hello]
25
+ expect(class_methods.all).to match_array([:bar, :hello])
26
26
  end
27
27
 
28
28
  it "returns the instance methods by name" do
29
- class_methods.get(:bar).should ==
30
- SampleClass.method(:bar)
29
+ expect(class_methods.get(:bar)).to eq SampleClass.method(:bar)
31
30
  end
32
31
 
33
32
  it "removes methods by name" do
34
33
  class_methods.remove(:hello)
35
34
 
36
- SampleClass.should_not respond_to(:hello)
35
+ expect(SampleClass).to_not respond_to(:hello)
37
36
  end
38
37
 
39
38
  it "defines instance methods" do
@@ -43,7 +42,7 @@ module Bogus
43
42
  end
44
43
  EOF
45
44
 
46
- SampleClass.greet("Joe").should == "Hello, Joe!"
45
+ expect(SampleClass.greet("Joe")).to eq "Hello, Joe!"
47
46
  end
48
47
  end
49
48
  end
@@ -15,19 +15,19 @@ describe Bogus::ConvertsNameToClass do
15
15
  it "finds classes in golbal namespace by default" do
16
16
  converts_name_to_class = Bogus::ConvertsNameToClass.new(Bogus.config.search_modules)
17
17
 
18
- converts_name_to_class.convert(:foo_bar_baz).should == FooBarBaz
18
+ expect(converts_name_to_class.convert(:foo_bar_baz)).to eq FooBarBaz
19
19
  end
20
20
 
21
21
  it "looks in the modules in the specified order" do
22
22
  converts_name_to_class = Bogus::ConvertsNameToClass.new([Foo, Bar])
23
23
 
24
- converts_name_to_class.convert(:foo_bar_baz).should == Foo::FooBarBaz
24
+ expect(converts_name_to_class.convert(:foo_bar_baz)).to eq Foo::FooBarBaz
25
25
  end
26
26
 
27
27
  it "looks in the next module on the list if the first does not contain the class" do
28
28
  converts_name_to_class = Bogus::ConvertsNameToClass.new([Foo, Bar])
29
29
 
30
- converts_name_to_class.convert(:bam).should == Bar::Bam
30
+ expect(converts_name_to_class.convert(:bam)).to eq Bar::Bam
31
31
  end
32
32
 
33
33
  it "raises an error if it can't find the class" do
@@ -20,33 +20,33 @@ describe Bogus::CopiesClasses do
20
20
 
21
21
  shared_examples_for 'the copied class' do
22
22
  it "copies methods with no arguments" do
23
- subject.should respond_to(:foo)
23
+ expect(subject).to respond_to(:foo)
24
24
  subject.foo
25
25
  end
26
26
 
27
27
  it "copies methods with explicit arguments" do
28
- subject.should respond_to(:bar)
28
+ expect(subject).to respond_to(:bar)
29
29
 
30
- subject.method(:bar).arity.should == 1
30
+ expect(subject.method(:bar).arity).to eq 1
31
31
 
32
32
  subject.bar('hello')
33
33
  end
34
34
 
35
35
  it "copies methods with variable arguments" do
36
- subject.should respond_to(:baz)
36
+ expect(subject).to respond_to(:baz)
37
37
 
38
38
  subject.baz('hello', 'foo', 'bar', 'baz')
39
39
  end
40
40
 
41
41
  it "copies methods with default arguments" do
42
- subject.should respond_to(:bam)
42
+ expect(subject).to respond_to(:bam)
43
43
 
44
44
  subject.bam
45
45
  subject.bam(hello: 'world')
46
46
  end
47
47
 
48
48
  it "copies methods with block arguments" do
49
- subject.should respond_to(:baa)
49
+ expect(subject).to respond_to(:baa)
50
50
 
51
51
  subject.baa('hello')
52
52
  subject.baa('hello') {}
@@ -66,7 +66,7 @@ describe Bogus::CopiesClasses do
66
66
  let(:klass) { FooWithInstanceMethods }
67
67
 
68
68
  it "does not overwrite nested constants" do
69
- fake_class::CONST.should == "the const"
69
+ expect(fake_class::CONST).to eq "the const"
70
70
  end
71
71
  end
72
72
 
@@ -91,13 +91,13 @@ describe Bogus::CopiesClasses do
91
91
  it "adds a no-arg constructor" do
92
92
  instance = fake_class.__create__
93
93
 
94
- instance.should respond_to(:foo)
94
+ expect(instance).to respond_to(:foo)
95
95
  end
96
96
 
97
97
  it "adds a constructor that allows passing the correct number of arguments" do
98
98
  instance = fake_class.new('hello')
99
99
 
100
- instance.should respond_to(:foo)
100
+ expect(instance).to respond_to(:foo)
101
101
  end
102
102
  end
103
103
 
@@ -121,27 +121,31 @@ describe Bogus::CopiesClasses do
121
121
  let(:klass) { SomeModule::SomeClass }
122
122
 
123
123
  it "should copy the class name" do
124
- fake.class.name.should == 'SomeModule::SomeClass'
124
+ expect(fake.class.name).to eq 'SomeModule::SomeClass'
125
125
  end
126
126
 
127
127
  it "should override kind_of?" do
128
- fake.kind_of?(SomeModule::SomeClass).should be_true
128
+ expect(fake.kind_of?(SomeModule::SomeClass)).to be_true
129
129
  end
130
130
 
131
131
  it "should override instance_of?" do
132
- fake.instance_of?(SomeModule::SomeClass).should be_true
132
+ expect(fake.instance_of?(SomeModule::SomeClass)).to be_true
133
133
  end
134
134
 
135
135
  it "should override is_a?" do
136
- fake.is_a?(SomeModule::SomeClass).should be_true
136
+ expect(fake.is_a?(SomeModule::SomeClass)).to be_true
137
137
  end
138
138
 
139
139
  it "should include class name in the output of fake's class #to_s" do
140
- fake.class.to_s.should include(klass.name)
140
+ expect(fake.class.to_s).to include(klass.name)
141
141
  end
142
142
 
143
143
  it "should include class name in the output of fake's #to_s" do
144
- fake.to_s.should include(klass.name)
144
+ expect(fake.to_s).to include(klass.name)
145
+ end
146
+
147
+ it 'should override ===' do
148
+ expect(SomeModule::SomeClass === fake).to be_true
145
149
  end
146
150
  end
147
151
 
@@ -193,7 +197,7 @@ describe Bogus::CopiesClasses do
193
197
  let(:klass) { SomeModel }
194
198
 
195
199
  it "copies those methods" do
196
- fake.should respond_to(:save)
200
+ expect(fake).to respond_to(:save)
197
201
  end
198
202
  end
199
203
  end