dancroak-webster 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/Rakefile +1 -1
  2. data/VERSION.yml +1 -1
  3. data/shoulda_macros/webster.rb +34 -0
  4. metadata +2 -1
data/Rakefile CHANGED
@@ -22,7 +22,7 @@ begin
22
22
  s.homepage = "http://github.com/dancroak/webster"
23
23
  s.description = "Generate random short words. Good for human-readable confirmation codes."
24
24
  s.authors = ["Dan Croak"]
25
- s.files = FileList["[A-Z]*", "{lib,test}/**/*"]
25
+ s.files = FileList["[A-Z]*", "{lib,test,shoulda_macros}/**/*"]
26
26
  end
27
27
  rescue LoadError
28
28
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- patch: 0
2
+ patch: 1
3
3
  major: 0
4
4
  minor: 4
@@ -0,0 +1,34 @@
1
+ module Webster
2
+ module Shoulda
3
+ # Example:
4
+ # context "Subscription#activation_code" do
5
+ # setup do
6
+ # subscription = Factory :subscription
7
+ # @code = subscription.set_activation_code
8
+ # end
9
+ #
10
+ # should_be_webster_word @code
11
+ #
12
+ def should_be_webster_word(word)
13
+ should "be webster word #{word}" do
14
+ assert_kind_of String, word,
15
+ "#{word} is not a string but is a #{word.class}."
16
+ assert_equal word, word.downcase,
17
+ "#{word} is not downcase"
18
+ assert word.length >= 5,
19
+ "#{word} should be greater than or equal to five characters long " <<
20
+ "but is #{word.length} characters long."
21
+ assert word.length <= 9,
22
+ "#{word} should be less than or equal to nine characters long " <<
23
+ "but is #{word.length} characters long."
24
+ assert_no_match /\n/, word,
25
+ "#{word} contains a carriage return."
26
+ assert Webster.new.dictionary.include?(word),
27
+ "#{word} should be a word in the Webster dictionary"
28
+ end
29
+ end
30
+
31
+ end
32
+ end
33
+
34
+ Test::Unit::TestCase.extend(Webster::Shoulda)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dancroak-webster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Croak
@@ -28,6 +28,7 @@ files:
28
28
  - lib/webster.rb
29
29
  - lib/words
30
30
  - test/webster_test.rb
31
+ - shoulda_macros/webster.rb
31
32
  has_rdoc: false
32
33
  homepage: http://github.com/dancroak/webster
33
34
  post_install_message: