Feature: Rosey Build Complex Background: Given I have the environment variables: | ROSEY_SOURCE | dist/site | | ROSEY_DEST | dist/translated_site | Scenario: Rosey build includes whitespace Given I have a "dist/site/index.html" file with the content: """
Kiss From A Rose
""" And I have a "rosey/locales/airy.json" file with the content: """ { "seal": "\n \n Kiss From A Rose\n" } """ When I run my program with the flags: | build | Then I should see a selector 'p' in "dist/translated_site/en/index.html" with the attributes: | data-rosey | seal | | innerText | \nKiss From A Rose\n | And I should see a selector 'p' in "dist/translated_site/airy/index.html" with the attributes: | data-rosey | seal | | innerText | \n \n Kiss From A Rose\n | Scenario: Rosey build includes HTML Given I have a "dist/site/index.html" file with the content: """Kiss From A Rose
Kiss From A Rose
" } """ When I run my program with the flags: | build | Then I should see a selector 'div > p' in "dist/translated_site/en/index.html" with the attributes: | innerText | Kiss From A Rose | And I should see a selector 'div > p > span' in "dist/translated_site/airy/index.html" with the attributes: | class | rose | | innerText | Rose | Scenario: Rosey build includes utf8 Given I have a "dist/site/index.html" file with the content: """🦭
𓀞𓂗𓃛𓄫𓋟
""" And I have a "rosey/locales/hmm.json" file with the content: """ { "e": "𓆔𓆫𓆿", "seal": "c̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲" } """ When I run my program with the flags: | build | Then I should see a selector 'p' in "dist/translated_site/en/index.html" with the attributes: | data-rosey | seal | | innerText | 🦭 | And I should see a selector 'p' in "dist/translated_site/en/index.html" with the attributes: | data-rosey | e | | innerText | 𓀞𓂗𓃛𓄫𓋟 | And I should see a selector 'p' in "dist/translated_site/hmm/index.html" with the attributes: | data-rosey | seal | | innerText | c̬̟h͡a̫̻̯͘o̫̟̖͍̙̝͉s̗̦̲ | And I should see a selector 'p' in "dist/translated_site/hmm/index.html" with the attributes: | data-rosey | e | | innerText | 𓆔𓆫𓆿 | Scenario: Rosey build includes utf8 keys Given I have a "dist/site/index.html" file with the content: """seal
e
""" And I have a "rosey/locales/rtl.json" file with the content: """ { "אֱלֹהִים": "١٢٣", "🦭": "بين ما, يذكر" } """ # 👆 This whole line is RTL, it's likely rendering as # { "value" :"key" ,"value" :"key" } When I run my program with the flags: | build | Then I should see a selector 'p' in "dist/translated_site/en/index.html" with the attributes: | data-rosey | 🦭 | | innerText | seal | And I should see a selector 'p' in "dist/translated_site/en/index.html" with the attributes: | data-rosey | אֱלֹהִים | | innerText | e | And I should see a selector 'p' in "dist/translated_site/rtl/index.html" with the attributes: | data-rosey | 🦭 | | innerText | بين ما, يذكر | And I should see a selector 'p' in "dist/translated_site/rtl/index.html" with the attributes: | data-rosey | אֱלֹהִים | | innerText | ١٢٣ | Scenario: Rosey build handles missing translations Given I have a "dist/site/index.html" file with the content: """Kiss From A Rose
Kiss From A Rose