fat_core 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -56,68 +56,68 @@ the people, for the people, shall not perish from the earth."
56
56
  end
57
57
 
58
58
  it "should wrap a short string" do
59
- "hello, world".wrap.should == "hello, world"
59
+ expect("hello, world".wrap).to eq "hello, world"
60
60
  end
61
61
 
62
62
  it "should wrap a long string" do
63
- @getty.wrap.split("\n").each {|l| l.length.should <= 70}
63
+ @getty.wrap.split("\n").each {|l| expect(l.length).to be <= 70}
64
64
  end
65
65
 
66
66
  it "should wrap a long string with a hangining indent" do
67
- @getty.wrap(70, 10).split("\n").each {|l| l.length.should <= 70}
67
+ @getty.wrap(70, 10).split("\n").each {|l| expect(l.length).to be <= 70}
68
68
  @getty.wrap(70, 10).split("\n")[1..-1].each do |l|
69
- l.should match(/^ /)
69
+ expect(l).to match(/^ /)
70
70
  end
71
71
  second_line = ' ' * 10 + 'nent a new nation'
72
72
  third_line = ' ' * 10 + 'e proposition'
73
73
  twenty_fourth_line = ' ' * 10 + 'eople, by the people, for the people'
74
- @getty.wrap(70, 10).split("\n")[1].should match(/^#{second_line}/)
75
- @getty.wrap(70, 10).split("\n")[2].should match(/^#{third_line}/)
76
- @getty.wrap(70, 10).split("\n")[23].should match(/^#{twenty_fourth_line}/)
74
+ expect(@getty.wrap(70, 10).split("\n")[1]).to match(/^#{second_line}/)
75
+ expect(@getty.wrap(70, 10).split("\n")[2]).to match(/^#{third_line}/)
76
+ expect(@getty.wrap(70, 10).split("\n")[23]).to match(/^#{twenty_fourth_line}/)
77
77
  end
78
78
 
79
79
  it "should be able to quote special TeX characters" do
80
- "$10,000".tex_quote.should eq("\\$10,000")
81
- "would~~have".tex_quote.should eq("would\\textasciitilde{}\\textasciitilde{}have")
82
- "<hello>".tex_quote.should eq("\\textless{}hello\\textgreater{}")
83
- "{hello}".tex_quote.should eq("\\{hello\\}")
80
+ expect("$10,000".tex_quote).to eq("\\$10,000")
81
+ expect("would~~have".tex_quote).to eq("would\\textasciitilde{}\\textasciitilde{}have")
82
+ expect("<hello>".tex_quote).to eq("\\textless{}hello\\textgreater{}")
83
+ expect("{hello}".tex_quote).to eq("\\{hello\\}")
84
84
  end
85
85
 
86
86
  it "should be able to fuzzy match with another string" do
87
- "Hello, world".fuzzy_match('or').should be_true
88
- "Hello, world".fuzzy_match('ox').should be_false
87
+ expect("Hello, world".fuzzy_match('or')).to be_truthy
88
+ expect("Hello, world".fuzzy_match('ox')).to be_falsy
89
89
  end
90
90
 
91
91
  it "should be able to fuzzy match with another string containing re" do
92
- "Hello, world".matches_with('/or/').should be_true
93
- "Hello, world".matches_with('/ox/').should be_false
92
+ expect("Hello, world".matches_with('/or/')).to be_truthy
93
+ expect("Hello, world".matches_with('/ox/')).to be_falsy
94
94
  end
95
95
 
96
96
  it "should be able to fuzzy match space-separated parts" do
97
- "Hello world".fuzzy_match('hel or').should be_true
98
- "Hello, world".fuzzy_match('hel ox').should be_false
97
+ expect("Hello world".fuzzy_match('hel or')).to be_truthy
98
+ expect("Hello, world".fuzzy_match('hel ox')).to be_falsy
99
99
  end
100
100
 
101
101
  it "should be able to fuzzy match colon-separated parts" do
102
- "Hello:world".fuzzy_match('hel:or').should be_true
103
- "Hello:world".fuzzy_match('hel:ox').should be_false
102
+ expect("Hello:world".fuzzy_match('hel:or')).to be_truthy
103
+ expect("Hello:world".fuzzy_match('hel:ox')).to be_falsy
104
104
  end
105
105
 
106
106
  it "should be able to fuzzy match colon-separated parts" do
107
- "Hello:world".fuzzy_match('hel:or').should be_true
108
- "Hello:world".fuzzy_match('hel:ox').should be_false
107
+ expect("Hello:world".fuzzy_match('hel:or')).to be_truthy
108
+ expect("Hello:world".fuzzy_match('hel:ox')).to be_falsy
109
109
  end
110
110
 
111
111
  it "should return the matched text" do
112
- "Hello:world".fuzzy_match('hel').should eq('Hel')
113
- "Hello:world".fuzzy_match('hel:or').should eq('Hello:wor')
114
- "Hello:world".matches_with('/^h.*r/').should eq('Hello:wor')
112
+ expect("Hello:world".fuzzy_match('hel')).to eq('Hel')
113
+ expect("Hello:world".fuzzy_match('hel:or')).to eq('Hello:wor')
114
+ expect("Hello:world".matches_with('/^h.*r/')).to eq('Hello:wor')
115
115
  end
116
116
 
117
117
  it "should ignore periods, commas, and apostrophes when matching" do
118
- "St. Luke's".fuzzy_match('st lukes').should eq('St Lukes')
119
- "St Lukes".fuzzy_match('st. luke\'s').should eq('St Lukes')
120
- "St Lukes, Inc.".fuzzy_match('st luke inc').should eq('St Lukes Inc')
118
+ expect("St. Luke's".fuzzy_match('st lukes')).to eq('St Lukes')
119
+ expect("St Lukes".fuzzy_match('st. luke\'s')).to eq('St Lukes')
120
+ expect("St Lukes, Inc.".fuzzy_match('st luke inc')).to eq('St Lukes Inc')
121
121
  end
122
122
 
123
123
  it "should be able to properly capitalize a string as a title" do
data/spec/spec_helper.rb CHANGED
@@ -11,10 +11,11 @@ require 'byebug'
11
11
  #
12
12
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
13
13
  RSpec.configure do |config|
14
- config.treat_symbols_as_metadata_keys_with_true_values = true
15
14
  config.run_all_when_everything_filtered = true
16
15
  config.filter_run :focus
17
16
 
17
+ config.raise_errors_for_deprecations!
18
+
18
19
  # Run specs in random order to surface order dependencies. If you find an
19
20
  # order dependency and want to debug it, you can fix the order by providing
20
21
  # the seed, which is printed after each run.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel E. Doherty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-26 00:00:00.000000000 Z
11
+ date: 2014-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler