Skip to content

Commit

Permalink
Fix bug in StarWars
Browse files Browse the repository at this point in the history
  • Loading branch information
psibi committed Feb 24, 2019
1 parent e36fcef commit b3f749b
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,7 @@ the `fake` library.
* nation - multibyte
* phone_number
* restaurant
* Write test for science - element
* stripe
* Write test for university - name
* vehicle -
* world_cup
2 changes: 1 addition & 1 deletion src/Faker/Provider/StarWars.hs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ resolveStarWarsText settings txt = do

resolveStarWarsField ::
(MonadThrow m, MonadIO m) => FakerSettings -> Text -> m Text
resolveStarWarsField settings "call_numbers" =
resolveStarWarsField settings "call_number" =
randomUnresolvedVec settings starWarsCall_numbersProvider resolveStarWarsText
resolveStarWarsField settings "call_sign" =
randomUnresolvedVec settings starWarsCall_signProvider resolveStarWarsText
Expand Down
12 changes: 12 additions & 0 deletions test/FakerSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import Faker.File
import Faker.Food
import Faker.Internal
import Faker.Provider.Educator
import qualified Faker.Science as FS
import Faker.StarWars
import Test.Hspec

isText :: Text -> Bool
Expand Down Expand Up @@ -63,3 +65,13 @@ spec = do
it "Food" $ do
ctries <- generate dish
ctries `shouldSatisfy` isText
it "Science" $ do
item <- generate FS.element
item `shouldSatisfy` isText
it "StarWars" $ do
item <- generate call_numbers
item `shouldSatisfy` isText
it "StarWars (2)" $ do
item <- generate call_sign
print item
item `shouldSatisfy` isText

0 comments on commit b3f749b

Please sign in to comment.