oxford_learners_dictionaries 0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,391 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <title>Oxford Learner&apos;s Dictionaries | Find pronunciation, clear meanings and definitions of words at OxfordLearnersDictionaries.com</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
+ <meta name="description" content="Oxford Learner&apos;s Dictionary - the largest and most trusted free online dictionary for learners of English. Quickly find clear definitions and audio pronunciations of words." />
7
+ <meta name="keywords" content="english dictionary, advanced, learner, dictionary, free, english, british english, american english, meaning, pronounce, audio pronunciation, synonym, synonyms, English grammar, Oxford, ELT, OALD, OAAD, phrases, phrase, idioms, idiom, phrasal verbs, phrasal verb" />
8
+ <link rel="alternate" hreflang="en" href="http://www.oxfordlearnersdictionaries.com"/>
9
+ <link rel="alternate" hreflang="en-US" href="http://www.oxfordlearnersdictionaries.com/us"/>
10
+ <link rel="alternate" hreflang="en-MX" href="http://www.oxfordlearnersdictionaries.com/us"/>
11
+ <link rel="alternate" hreflang="en-PH" href="http://www.oxfordlearnersdictionaries.com/us"/>
12
+ <link rel="alternate" hreflang="en-BR" href="http://www.oxfordlearnersdictionaries.com/us"/>
13
+ <link rel="alternate" hreflang="en-CO" href="http://www.oxfordlearnersdictionaries.com/us"/>
14
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
15
+ <meta name='viewport' content='width=device-width, initial-scale=1' />
16
+ <link href="http://www.oxfordlearnersdictionaries.com/us/external/styles/interface.css?version=1.1.28" rel="stylesheet" type="text/css" />
17
+ <link href="http://www.oxfordlearnersdictionaries.com/us/external/styles/responsive2columns.css?version=1.1.28" rel="stylesheet" type="text/css" />
18
+ <link href="http://www.oxfordlearnersdictionaries.com/us/external/styles/oxford.css?version=1.1.28" rel="stylesheet" type="text/css" />
19
+ <link rel="icon" type="image/x-icon" href="http://www.oxfordlearnersdictionaries.com/us/external/images/favicon.ico?version=1.1.28"/>
20
+ <link href="http://www.oxfordlearnersdictionaries.com/us/external/styles/print.css?version=1.1.28" rel="stylesheet" type="text/css" media="print" />
21
+ <script language="javascript" type="text/javascript" src="http://www.oxfordlearnersdictionaries.com/us/external/scripts/navigation_menu.js?version=1.1.28"></script>
22
+ <!--[if IE 9]><script type="text/javascript" src="http://www.oxfordlearnersdictionaries.com/us/external/scripts/matchMedia.js?version=1.1.28"></script><![endif]-->
23
+ <script type='text/javascript'>
24
+ var googletag = googletag || {};
25
+ googletag.cmd = googletag.cmd || [];
26
+ (function() {
27
+ var gads = document.createElement('script');
28
+ gads.async = true;
29
+ gads.type = 'text/javascript';
30
+ var useSSL = 'https:' == document.location.protocol;
31
+ gads.src = (useSSL ? 'https:' : 'http:') +'//www.googletagservices.com/tag/js/gpt.js';
32
+ var node = document.getElementsByTagName('script')[0];
33
+ node.parentNode.insertBefore(gads, node);
34
+ })();
35
+
36
+ googletag.cmd.push(function() {
37
+ var smartphone = false;
38
+ var tablet = false;
39
+ var hd = false;
40
+ try{
41
+ var smartphone = window.matchMedia("(max-width: 761px)").matches;
42
+ var tablet = window.matchMedia("(min-width: 762px) and (max-width: 928px)").matches;
43
+ var hd = window.matchMedia("(min-width: 1220px)").matches;
44
+ }catch(err){}
45
+ var desktop = (!smartphone && !tablet && !hd);
46
+ if (smartphone && false || tablet && true || desktop && true || hd && true)
47
+ googletag.defineSlot('/70903302/Home_728x90', [728, 90], 'dfp_ad_Home_728x90').addService(googletag.pubads());
48
+ if (smartphone && true || tablet && false || desktop && false || hd && false)
49
+ googletag.defineSlot('/70903302/Home_320x50', [320, 50], 'dfp_ad_Home_320x50').addService(googletag.pubads());
50
+ if (smartphone && true || tablet && true || desktop && true || hd && true)
51
+ googletag.defineSlot('/70903302/Home_180x150', [180, 150], 'dfp_ad_Home_180x150').addService(googletag.pubads());
52
+ if (smartphone && true || tablet && false || desktop && false || hd && false)
53
+ googletag.defineSlot('/70903302/Home_300x250', [300, 250], 'dfp_ad_Home_300x250').addService(googletag.pubads());
54
+ if (smartphone && false || tablet && true || desktop && true || hd && true)
55
+ googletag.defineSlot('/70903302/Home_Btm_300x250', [300, 250], 'dfp_ad_Home_Btm_300x250').addService(googletag.pubads());
56
+ googletag.pubads().enableSingleRequest();
57
+ googletag.enableServices();
58
+ });
59
+ </script>
60
+ </head>
61
+ <body>
62
+ <div id="ox-container">
63
+ <div id="ox-header" class="responsive_row">
64
+ <div class="responsive_row top">
65
+ <div class="nav" style="float:left;">
66
+ <a href="http://www.oxfordlearnersdictionaries.com/us/">Home</a>
67
+ </div>
68
+ <div class="nav">
69
+ <div class="menu responsive_hide_on_smartphone">
70
+ <ul>
71
+ <li></li>
72
+ <li><a href="http://www.oxfordlearnersdictionaries.com/us/wordlist/">Wordlists</a></li>
73
+ <li><a href="http://www.oxfordlearnersdictionaries.com/us/about/">About</a></li>
74
+ </ul>
75
+ </div>
76
+ <div class="responsive_display_on_smartphone">
77
+ <a id="toggleMenu" class="toggleMenuBg" href="#" onclick="displayMenu('navMenu')">
78
+ </a>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ <nav id="navMenu" style="display:none;">
83
+ <div class="navMenuLeft"><div class="navMenuContainer"><a href="http://www.oxfordlearnersdictionaries.com/us/wordlist/"><b>Wordlists</b></a></div></div>
84
+ <div class="navMenuRight"><div class="navMenuContainer"><a href="http://www.oxfordlearnersdictionaries.com/us/about/"><b>About</b></a></div></div>
85
+
86
+
87
+ </nav>
88
+ </div>
89
+ <div class="responsive_container">
90
+ <div class="responsive_row"><div class="old-logo-title"></div></div>
91
+ <div class="responsive_row responsive_mainsearch_center">
92
+ <div class="mainsearch">
93
+ <form id="search-form" method="get" action="http://www.oxfordlearnersdictionaries.com/us/search/english/direct/" onsubmit="return checkSearch('Type here');">
94
+ <div class="dictionarySelector"> <select id="dictionary-selector">
95
+ <option value="english" selected="selected">English</option>
96
+ <option value="american_english" >American English</option>
97
+ </select>
98
+ </div>
99
+ <input type="text" id="q" name="q"
100
+ value="Type here" class="searchfield"
101
+ onfocus="this.value=(this.value=='Type here') ? changeText('', this) : this.value;"
102
+ onblur="this.value=(this.value=='') ? changeText('Type here', this) : this.value;" />
103
+ <input type="submit" id="search-btn" value="" />
104
+ </form>
105
+ </div>
106
+ </div>
107
+ <div class="responsive_row" style="margin-bottom:17px;">
108
+
109
+
110
+ <div class='responsive_center responsive_hide_on_smartphone'>
111
+ <div id='dfp_ad_Home_728x90' style='width:728px; height:90px;'>
112
+ <script type='text/javascript'>
113
+ var smartphone = false;
114
+ var tablet = false;
115
+ var hd = false;
116
+ try{
117
+ var smartphone = window.matchMedia("(max-width: 761px)").matches;
118
+ var tablet = window.matchMedia("(min-width: 762px) and (max-width: 928px)").matches;
119
+ var hd = window.matchMedia("(min-width: 1220px)").matches;
120
+ }catch(err){}
121
+ var desktop = (!smartphone && !tablet && !hd);
122
+ if (smartphone && false || tablet && true || desktop && true || hd && true)
123
+ googletag.cmd.push(function() {googletag.display('dfp_ad_Home_728x90'); });
124
+ </script>
125
+ </div>
126
+
127
+ </div>
128
+
129
+
130
+ <div class='responsive_center_on_smartphone responsive_hide_on_tablet responsive_hide_on_desktop responsive_hide_on_hd'>
131
+ <div id='dfp_ad_Home_320x50' style='width:320px; height:50px;'>
132
+ <script type='text/javascript'>
133
+ var smartphone = false;
134
+ var tablet = false;
135
+ var hd = false;
136
+ try{
137
+ var smartphone = window.matchMedia("(max-width: 761px)").matches;
138
+ var tablet = window.matchMedia("(min-width: 762px) and (max-width: 928px)").matches;
139
+ var hd = window.matchMedia("(min-width: 1220px)").matches;
140
+ }catch(err){}
141
+ var desktop = (!smartphone && !tablet && !hd);
142
+ if (smartphone && true || tablet && false || desktop && false || hd && false)
143
+ googletag.cmd.push(function() {googletag.display('dfp_ad_Home_320x50'); });
144
+ </script>
145
+ </div>
146
+
147
+ </div>
148
+ </div>
149
+ <div class="responsive_row">
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+ <div id="homeleft" class="responsive_cell_left">
177
+ <div class="responsive_row responsive_hide_on_smartphone"><h1 style="margin-bottom:6px;">Welcome to Oxford Learner&apos;s Dictionaries</h1></div>
178
+ <div id="home-container" class="responsive_row responsive_center_on_smartphone responsive_display_on_smartphone">
179
+ <div id="wotd-box">
180
+ <div id="dayhead">
181
+ <div id="boxtitle">Word of the Day</div>
182
+ <div style="float:right; margin-top:-1px">
183
+ <span class="rss-icon" style="float:right;"><img src="http://www.oxfordlearnersdictionaries.com/us/external/images/home/rss-icon.gif?version=1.1.28" alt="rss-icon" /></span>
184
+ <a href="http://www.oxfordlearnersdictionaries.com/us/wotd/american_english/wotdrss.xml"><span class="subscribe">subscribe</span></a>
185
+ </div>
186
+ </div>
187
+ <a href="http://www.oxfordlearnersdictionaries.com/us/definition/american_english/election" title="View today&apos;s Word of the Day">
188
+ <div id="daybox"><h2 class='h'>election</h2><div class='d'>the process of choosing a person or a group of people&hellip;</div></div>
189
+ </a>
190
+ </div> </div>
191
+ <div class="responsive_row responsive_display_on_smartphone">
192
+ <table class="recentsearches">
193
+ <tr><th>Recent popular searches</th></tr>
194
+ <tr><td><a href="http://www.oxfordlearnersdictionaries.com/us/definition/english/download_1">download <span class="pos">verb</span></a></td></tr>
195
+ <tr><td><a href="http://www.oxfordlearnersdictionaries.com/us/definition/english/subtle">subtle <span class="pos">adjective</span></a></td></tr>
196
+ <tr><td><a href="http://www.oxfordlearnersdictionaries.com/us/definition/english/appreciate">appreciate <span class="pos">verb</span></a></td></tr>
197
+ <tr><td><a href="http://www.oxfordlearnersdictionaries.com/us/definition/english/entrepreneur">entrepreneur <span class="pos">noun</span></a></td></tr>
198
+ <tr><td><a href="http://www.oxfordlearnersdictionaries.com/us/definition/english/mesmerize">mesmerize <span class="pos">verb</span></a></td></tr>
199
+ </table>
200
+ </div>
201
+ <div class="responsive_row">
202
+
203
+
204
+ <div class='responsive_center_on_smartphone responsive_hide_on_tablet responsive_hide_on_desktop responsive_hide_on_hd'>
205
+ <div id='dfp_ad_Home_300x250' style='width:300px; height:250px;'>
206
+ <script type='text/javascript'>
207
+ var smartphone = false;
208
+ var tablet = false;
209
+ var hd = false;
210
+ try{
211
+ var smartphone = window.matchMedia("(max-width: 761px)").matches;
212
+ var tablet = window.matchMedia("(min-width: 762px) and (max-width: 928px)").matches;
213
+ var hd = window.matchMedia("(min-width: 1220px)").matches;
214
+ }catch(err){}
215
+ var desktop = (!smartphone && !tablet && !hd);
216
+ if (smartphone && true || tablet && false || desktop && false || hd && false)
217
+ googletag.cmd.push(function() {googletag.display('dfp_ad_Home_300x250'); });
218
+ </script>
219
+ </div>
220
+
221
+ </div>
222
+ </div>
223
+ <div class="responsive_row">
224
+ <div class="responsive_cell_left_left">
225
+ <div class="responsive_row upLeftCell">
226
+ <h2>What's new?</h2>
227
+ <p>We have combined the <em>Oxford Advanced Learner's Dictionary</em> (OALD) and the <em>Oxford Advanced American Dictionary </em>(OAAD) into one site. Now you can choose which dictionary you'd like to look up words in.</p>
228
+ <p>Simply choose <strong>English </strong>from the drop-down menu next to the search box to see an entry from the <em>Oxford Advanced Learner's Dictionary</em>, or <strong>American English </strong>to see an entry from the <em>Oxford Advanced American Dictionary</em>.
229
+ </p>
230
+ </div>
231
+ <div class="responsive_row downLeftCell responsive_hide_on_tablet responsive_hide_on_smartphone">
232
+ <h2>Using a smartphone or tablet?</h2>
233
+ <p>oxfordlearnersdictionaries.com now works on smartphones and tablets as well as on desktops and laptops. Find out what you need to know on any device, and for free!
234
+ </p>
235
+ </div>
236
+ </div>
237
+ <div class="responsive_cell_left_right">
238
+ <div class="responsive_row upRightCell">
239
+ <h2>At oxfordlearnersdictionaries.com you can...</h2>
240
+ <p>Look up any word, and</p>
241
+ <ul>
242
+ <li><span class="blacktext"><strong>understand what it means</strong> with our clear definitions</span> written using only <span class="blacktext">the <a style="text-decoration:underline" href="http://www.oxfordlearnersdictionaries.com/us/wordlist/american_english/oxford3000/">Oxford 3000&#153;</a> keywords</span></li>
243
+ <li><span class="blacktext"><strong>know how to use it</strong> with our example sentences and usage information</span></li>
244
+ <li><span class="blacktext"><strong>learn how to say it</strong> with our real British and American pronunciations</span></li>
245
+ </ul>
246
+ </div>
247
+ <div class="responsive_row responsive_display_on_tablet responsive_display_on_smartphone hiddenRighCell">
248
+ <h2>Using a smartphone or tablet?</h2>
249
+ <p>oxfordlearnersdictionaries.com now works on smartphones and tablets as well as on desktops and laptops. Find out what you need to know on any device, and for free!
250
+ </div>
251
+ <div class="responsive_row downRightCell">
252
+ <!-- Begin content of following box in right column here -->
253
+ <h2>Discover our dictionaries</h2>
254
+ <p>The <a href="https://elt.oup.com/catalogue/items/global/dictionaries/oxford_advanced_learners_dictionary_8th_edition" target="_blank">Oxford Advanced Learner's Dictionary</a> is the world's best-selling advanced learner's dictionary, used by over 35 million leaners of English.</p>
255
+ <p>The <a href="https://elt.oup.com/catalogue/items/global/dictionaries/oxford_american_dictionaries/9780194399661" target="_blank">Oxford Advanced American Dictionary</a> is a dictionary specially created for learners of American English.</p>
256
+ </div>
257
+ </div>
258
+ </div>
259
+ <div class="responsive_row responsive_hide_on_smartphone">
260
+ <div class="responsive_cell_left_right responsive_recentsearches">
261
+ <table class="recentsearches">
262
+ <tr><th>Recent popular searches</th></tr>
263
+ <tr><td><a href="http://www.oxfordlearnersdictionaries.com/us/definition/english/download_1">download <span class="pos">verb</span></a></td></tr>
264
+ <tr><td><a href="http://www.oxfordlearnersdictionaries.com/us/definition/english/subtle">subtle <span class="pos">adjective</span></a></td></tr>
265
+ <tr><td><a href="http://www.oxfordlearnersdictionaries.com/us/definition/english/appreciate">appreciate <span class="pos">verb</span></a></td></tr>
266
+ <tr><td><a href="http://www.oxfordlearnersdictionaries.com/us/definition/english/entrepreneur">entrepreneur <span class="pos">noun</span></a></td></tr>
267
+ <tr><td><a href="http://www.oxfordlearnersdictionaries.com/us/definition/english/mesmerize">mesmerize <span class="pos">verb</span></a></td></tr>
268
+ </table>
269
+ </div>
270
+ <div class="responsive_cell_left_left responsive_wotd">
271
+ <div id="wotd-box">
272
+ <div id="dayhead">
273
+ <div id="boxtitle">Word of the Day</div>
274
+ <div style="float:right; margin-top:-1px">
275
+ <span class="rss-icon" style="float:right;"><img src="http://www.oxfordlearnersdictionaries.com/us/external/images/home/rss-icon.gif?version=1.1.28" alt="rss-icon" /></span>
276
+ <a href="http://www.oxfordlearnersdictionaries.com/us/wotd/american_english/wotdrss.xml"><span class="subscribe">subscribe</span></a>
277
+ </div>
278
+ </div>
279
+ <a href="http://www.oxfordlearnersdictionaries.com/us/definition/american_english/election" title="View today&apos;s Word of the Day">
280
+ <div id="daybox"><h2 class='h'>election</h2><div class='d'>the process of choosing a person or a group of people&hellip;</div></div>
281
+ </a>
282
+ </div> </div>
283
+ </div>
284
+
285
+ <div class="responsive_row" style="padding-top:8px;">
286
+
287
+
288
+ <div class='responsive_center responsive_hide_on_smartphone'>
289
+ <div id='dfp_ad_Home_Btm_300x250' style='width:300px; height:250px;'>
290
+ <script type='text/javascript'>
291
+ var smartphone = false;
292
+ var tablet = false;
293
+ var hd = false;
294
+ try{
295
+ var smartphone = window.matchMedia("(max-width: 761px)").matches;
296
+ var tablet = window.matchMedia("(min-width: 762px) and (max-width: 928px)").matches;
297
+ var hd = window.matchMedia("(min-width: 1220px)").matches;
298
+ }catch(err){}
299
+ var desktop = (!smartphone && !tablet && !hd);
300
+ if (smartphone && false || tablet && true || desktop && true || hd && true)
301
+ googletag.cmd.push(function() {googletag.display('dfp_ad_Home_Btm_300x250'); });
302
+ </script>
303
+ </div>
304
+
305
+ </div>
306
+ </div>
307
+ </div>
308
+
309
+ <div class="responsive_cell_right">
310
+
311
+ <div class="responsive_row">
312
+
313
+
314
+ <div class='responsive_center_on_smartphone'>
315
+ <div id='dfp_ad_Home_180x150' style='width:180px; height:150px;'>
316
+ <script type='text/javascript'>
317
+ var smartphone = false;
318
+ var tablet = false;
319
+ var hd = false;
320
+ try{
321
+ var smartphone = window.matchMedia("(max-width: 761px)").matches;
322
+ var tablet = window.matchMedia("(min-width: 762px) and (max-width: 928px)").matches;
323
+ var hd = window.matchMedia("(min-width: 1220px)").matches;
324
+ }catch(err){}
325
+ var desktop = (!smartphone && !tablet && !hd);
326
+ if (smartphone && true || tablet && true || desktop && true || hd && true)
327
+ googletag.cmd.push(function() {googletag.display('dfp_ad_Home_180x150'); });
328
+ </script>
329
+ </div>
330
+
331
+ </div>
332
+ </div>
333
+ </div>
334
+
335
+ </div>
336
+ <div id="ox-footer" class="responsive_row">
337
+ <div class="responsive_footer_left">
338
+ <div class="ox-oupLogo responsive_footer_left_left"></div>
339
+ <div class="versionSelector responsive_footer_left_right">
340
+ <select name="lang" id="headerVersion" title="Select language">
341
+
342
+
343
+ <option
344
+ name="uk"
345
+ value="http://www.oxfordlearnersdictionaries.com/">English (UK)</option>
346
+
347
+
348
+ <option
349
+ selected="selected" name="us"
350
+ value="http://www.oxfordlearnersdictionaries.com/us/">English (US)</option>
351
+
352
+
353
+ </select>
354
+ </div>
355
+ </div>
356
+ <ul id="footlinks">
357
+ <li>&copy; 2014 Oxford University Press</li>
358
+ <li><a href="http://www.oxfordlearnersdictionaries.com/us/search_widget_info.html">Dictionary search for your site</a></li>
359
+ <li><a href="http://elt.oup.com/" onclick="return ! window.open(this.href);">OUP English Language Teaching website</a></li>
360
+ <li><a href="http://www.oxfordlearnersdictionaries.com/us/browse/">Browse Dictionaries</a></li>
361
+ <li><a href="http://www.oxfordlearnersdictionaries.com/us/privacy.html">Privacy &amp; Legal notice</a></li>
362
+ </ul>
363
+ </div>
364
+
365
+ </div>
366
+ </div>
367
+ <script language="JavaScript" type="text/javascript" src="http://www.oxfordlearnersdictionaries.com/us/common.js?version=1.1.28"></script>
368
+ <script language="javascript" type="text/javascript" src="http://www.oxfordlearnersdictionaries.com/us/external/scripts/doubleclick.js?version=1.1.28"></script>
369
+ <script language="javascript" type="text/javascript">
370
+ $(document).ready(function() { setupDoubleClick('http://www.oxfordlearnersdictionaries.com/us/', 'english', false, 'main-container', null, null, null); });
371
+ </script>
372
+ <script language="javascript" type="text/javascript" src="http://www.oxfordlearnersdictionaries.com/us/external/scripts/responsive.js?version=1.1.28"></script>
373
+ <script>
374
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
375
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
376
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
377
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
378
+
379
+ ga('create', 'UA-13175707-1',
380
+ {
381
+ 'siteSpeedSampleRate': 10
382
+ });
383
+ ga('send', 'pageview');
384
+ </script>
385
+
386
+ <script type="text/javascript">_qoptions={ qacct:"p-cfSla1Cke_iBQ" };</script>
387
+ <script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
388
+ <noscript><img src="http://pixel.quantserve.com/pixel/p-cfSla1Cke_iBQ.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/></noscript>
389
+
390
+ </body>
391
+ </html>
@@ -0,0 +1,131 @@
1
+ require 'spec_helper'
2
+
3
+ describe OxfordLearnersDictionaries::English do
4
+
5
+ let(:word) { "word" }
6
+ let(:dictionary) { described_class.new(word) }
7
+ let(:url) { "http://www.oxfordlearnersdictionaries.com/definition/english/#{word}" }
8
+
9
+ describe '.initialize' do
10
+
11
+ it 'initializes @word' do
12
+ expect(dictionary.word).to eq word
13
+ end
14
+
15
+ it 'initializes @url' do
16
+ expect(dictionary.url).to eq url
17
+ end
18
+
19
+ it 'initializes @definition' do
20
+ expect(dictionary.definition).to eq Hash.new
21
+ end
22
+ end
23
+
24
+ describe '#look_up' do
25
+ it 'open url and parse data' do
26
+ stub_request(:any, url).to_return(body: "fpgentil")
27
+ expect(dictionary).to receive(:parse).and_return(true)
28
+ dictionary.look_up
29
+ end
30
+ end
31
+
32
+ describe "looking up a word" do
33
+ before :each do
34
+ stub_request(:any, url).to_return(body: File.new(fixture))
35
+ dictionary.look_up
36
+ end
37
+
38
+ describe 'important words' do
39
+ let(:fixture) { "./spec/fixtures/#{word}.html" }
40
+
41
+ context '#take' do
42
+ let(:word) { 'take' }
43
+ let(:type) { 'verb' }
44
+ let(:count) { 42 }
45
+
46
+ it 'matches noun' do
47
+ expect(dictionary.type).to eq type
48
+ end
49
+
50
+ it 'counts 3 definitions' do
51
+ expect(dictionary.definition.count).to eq count
52
+ end
53
+ end
54
+
55
+ context '#get' do
56
+ let(:word) { 'get' }
57
+ let(:type) { 'verb' }
58
+ let(:count) { 27 }
59
+
60
+ it 'matches noun' do
61
+ expect(dictionary.type).to eq type
62
+ end
63
+
64
+ it 'counts 3 definitions' do
65
+ expect(dictionary.definition.count).to eq count
66
+ end
67
+ end
68
+ end
69
+
70
+ describe 'when a word has more than one definitions' do
71
+ let(:definition_0) { "a road vehicle with an engine and four wheels that can carry a small number of passengers" }
72
+ let(:definition_1) { "a separate section of a train" }
73
+ let(:definition_2) { "a coach/car on a train of a particular type" }
74
+ let(:fixture) { "./spec/fixtures/car.html" }
75
+
76
+ it 'counts 3 definitions' do
77
+ expect(dictionary.definition.count).to eq 3
78
+ end
79
+
80
+ it 'shows all definitions in Hash' do
81
+ expect(dictionary.definition[:definition_0]).to eq definition_0
82
+ expect(dictionary.definition[:definition_1]).to eq definition_1
83
+ expect(dictionary.definition[:definition_2]).to eq definition_2
84
+ end
85
+ end
86
+
87
+ describe 'when a word has only one definition' do
88
+ let(:definition) { "a large powerful animal of the cat family, that hunts in groups" }
89
+ let(:fixture) { "./spec/fixtures/lion.html" }
90
+
91
+ it 'counts 1 definition' do
92
+ expect(dictionary.definition.count).to eq 1
93
+ end
94
+
95
+ it 'shows definition in Hash' do
96
+ expect(dictionary.definition[:definition_0]).to match definition
97
+ end
98
+ end
99
+
100
+ describe 'getting type from words' do
101
+ let(:fixture) { "./spec/fixtures/#{word}.html" }
102
+
103
+ context 'when its a noun' do
104
+ let(:type) { "noun" }
105
+ let(:word) { "car" }
106
+
107
+ it 'matches noun' do
108
+ expect(dictionary.type).to eq type
109
+ end
110
+ end
111
+
112
+ context 'when its a verb' do
113
+ let(:type) { "verb" }
114
+ let(:word) { "live" }
115
+
116
+ it 'matches verb' do
117
+ expect(dictionary.type).to eq type
118
+ end
119
+ end
120
+
121
+ context 'when its an adverb' do
122
+ let(:type) { "adverb" }
123
+ let(:word) { "however" }
124
+
125
+ it 'matches adverb' do
126
+ expect(dictionary.type).to eq type
127
+ end
128
+ end
129
+ end
130
+ end
131
+ end