|
34 | 34 |
|
35 | 35 | describe "#exchange_with" do |
36 | 36 | it "accepts str" do |
37 | | - expect { bank.exchange_with(Money.new(100, 'USD'), 'EUR') }.to_not raise_error |
| 37 | + expect { bank.exchange_with(Money.new(100, 'USD'), 'EUR') }.not_to raise_error |
38 | 38 | end |
39 | 39 |
|
40 | 40 | it "accepts currency" do |
41 | | - expect { bank.exchange_with(Money.new(100, 'USD'), Money::Currency.wrap('EUR')) }.to_not raise_error |
| 41 | + expect { bank.exchange_with(Money.new(100, 'USD'), Money::Currency.wrap('EUR')) }.not_to raise_error |
42 | 42 | end |
43 | 43 |
|
44 | 44 | it "exchanges one currency to another" do |
|
109 | 109 | describe "#add_rate" do |
110 | 110 | it 'delegates to store#add_rate' do |
111 | 111 | expect(subject.store).to receive(:add_rate).with('USD', 'EUR', 1.25).and_return 1.25 |
112 | | - expect(subject.add_rate('USD', 'EUR', 1.25)).to eql 1.25 |
| 112 | + expect(subject.add_rate('USD', 'EUR', 1.25)).to be 1.25 |
113 | 113 | end |
114 | 114 |
|
115 | 115 | it "adds rates with correct ISO codes" do |
|
129 | 129 | describe "#set_rate" do |
130 | 130 | it 'delegates to store#add_rate' do |
131 | 131 | expect(subject.store).to receive(:add_rate).with('USD', 'EUR', 1.25).and_return 1.25 |
132 | | - expect(subject.set_rate('USD', 'EUR', 1.25)).to eql 1.25 |
| 132 | + expect(subject.set_rate('USD', 'EUR', 1.25)).to be 1.25 |
133 | 133 | end |
134 | 134 |
|
135 | 135 | it "sets a rate" do |
|
159 | 159 | end |
160 | 160 |
|
161 | 161 | describe "#export_rates" do |
162 | | - before :each do |
| 162 | + before do |
163 | 163 | subject.set_rate('USD', 'EUR', 1.25) |
164 | 164 | subject.set_rate('USD', 'JPY', 2.55) |
165 | 165 |
|
166 | 166 | @rates = { "USD_TO_EUR" => 1.25, "USD_TO_JPY" => 2.55 } |
167 | 167 | end |
168 | 168 |
|
169 | 169 | context "with format == :json" do |
170 | | - it "should return rates formatted as json" do |
| 170 | + it "returns rates formatted as json" do |
171 | 171 | json = subject.export_rates(:json) |
172 | 172 | expect(JSON.load(json)).to eq @rates |
173 | 173 | end |
174 | 174 | end |
175 | 175 |
|
176 | 176 | context "with format == :ruby" do |
177 | | - it "should return rates formatted as ruby objects" do |
| 177 | + it "returns rates formatted as ruby objects" do |
178 | 178 | expect(Marshal.load(subject.export_rates(:ruby))).to eq @rates |
179 | 179 | end |
180 | 180 | end |
181 | 181 |
|
182 | 182 | context "with format == :yaml" do |
183 | | - it "should return rates formatted as yaml" do |
| 183 | + it "returns rates formatted as yaml" do |
184 | 184 | yaml = subject.export_rates(:yaml) |
185 | 185 | expect(YAML.load(yaml)).to eq @rates |
186 | 186 | end |
|
263 | 263 |
|
264 | 264 | describe "#marshal_dump" do |
265 | 265 | it "does not raise an error" do |
266 | | - expect { Marshal.dump(subject) }.to_not raise_error |
| 266 | + expect { Marshal.dump(subject) }.not_to raise_error |
267 | 267 | end |
268 | 268 |
|
269 | 269 | it "works with Marshal.load" do |
|
0 commit comments