first_gem_yiyang_song 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd58e23f71cf773d59dcfc53da5663315159afb4
4
- data.tar.gz: 88ef9a939ac43aefa63cc9f7136ed9df14f0b524
3
+ metadata.gz: 6ce194cd543ce20d02db7b0e26a61df02649bf8c
4
+ data.tar.gz: e7b7f70c4dfec28e5ccf64cec5c04adcfd621642
5
5
  SHA512:
6
- metadata.gz: cfadbdc54ff45d812571ce616cf9b18bb5485995dd5b66b99b14d3cacc2edf494226b109956e5fb54c44764be2eb7fd89ef265ef2570f06a9284cc845917136d
7
- data.tar.gz: 7833536369b279791eb9fdb8ef82699f50a629d3e0e716d75be3683c5b08b63d5593dbcc8d27a1501b9da13268f7006a281777f954a6b4567ead838d90ec0981
6
+ metadata.gz: cf34d1801269142ea57a41a1aca3b1bd0c3f857ccbae2e29324307babe7b86f922e1522bf1213d6756ef2afae65a961534a63bd1ebc74d55dff18701776e5d5d
7
+ data.tar.gz: 5a1008f8c319c94e3c8bb37400beda39b4df01cf1d1b529b664937ab6915773a2c24159e77c1f6ac58d6c2f85f3907d21a90f2989b87b8e4b63a9fc98b1e0dc0
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # FirstGemYiyangSong
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/first_gem_yiyang_song.png)](http://badge.fury.io/rb/first_gem_yiyang_song)
4
+
5
+
3
6
  TODO: Write a gem description
4
7
 
5
8
  ## Installation
@@ -20,4 +20,5 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.5"
22
22
  spec.add_development_dependency "rake"
23
+ spec.add_development_dependency "rspec", "~> 3.0.0.beta"
23
24
  end
@@ -6,6 +6,6 @@ class String
6
6
  end
7
7
 
8
8
  def unique_words
9
- sel.split.uniq
9
+ self.split.uniq
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module FirstGemYiyangSong
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ describe String, "#word_count" do
4
+ it 'should have a method called word_count' do
5
+ should respond_to :word_count
6
+ end
7
+
8
+ it 'should return 1 when the string is one word long' do
9
+ a_string = "apple"
10
+ the_word_count = a_string.word_count
11
+ expect(the_word_count).to be 1
12
+ end
13
+ end
14
+
15
+ describe String, '#unique_word' do
16
+ it 'should have a method called unique_words' do
17
+ should respond_to :unique_words
18
+ end
19
+ it 'should return 1 when the string is one word long' do
20
+ a_string = "apple"
21
+ the_word_count = a_string.unique_words
22
+ expect(the_word_count).to eq ["apple"]
23
+ end
24
+ it 'should return 2 words when the string is three and two unique' do
25
+ a_string = 'apple apple orange'
26
+ the_word_count = a_string.unique_words
27
+ expect(the_word_count).to eq ["apple", "orange"]
28
+ end
29
+ end
30
+
@@ -0,0 +1,12 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'first_gem_yiyang_song'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ RSpec.configure do |config|
11
+
12
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: first_gem_yiyang_song
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yiyang Song
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 3.0.0.beta
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 3.0.0.beta
41
55
  description: Write a longer description. Optional.
42
56
  email:
43
57
  - songyiyang2012@gmail.com
@@ -46,6 +60,7 @@ extensions: []
46
60
  extra_rdoc_files: []
47
61
  files:
48
62
  - ".gitignore"
63
+ - ".rspec"
49
64
  - Gemfile
50
65
  - LICENSE.txt
51
66
  - README.md
@@ -53,6 +68,8 @@ files:
53
68
  - first_gem_yiyang_song.gemspec
54
69
  - lib/first_gem_yiyang_song.rb
55
70
  - lib/first_gem_yiyang_song/version.rb
71
+ - spec/first_gem_yiyang_song_spec.rb
72
+ - spec/spec_helper.rb
56
73
  homepage: ''
57
74
  licenses:
58
75
  - MIT
@@ -77,4 +94,6 @@ rubygems_version: 2.2.0
77
94
  signing_key:
78
95
  specification_version: 4
79
96
  summary: The word count
80
- test_files: []
97
+ test_files:
98
+ - spec/first_gem_yiyang_song_spec.rb
99
+ - spec/spec_helper.rb