Skip to content

Instantly share code, notes, and snippets.

@jbrains
Last active December 26, 2015 09:29
Show Gist options
  • Save jbrains/7130069 to your computer and use it in GitHub Desktop.
Save jbrains/7130069 to your computer and use it in GitHub Desktop.
Now that's a test list!
require "rspec"
describe "gist_no_css tag" do
context "the pieces" do
context "rendering code" do
# Assume we've already successfully downloaded code
example "gist ID, username and filename"
example "gist ID and filename"
example "gist ID and username"
example "gist ID"
end
context "downloading gist code" do
context "gist found" do
context "gist has only one file" do
example "filename specified"
example "filename not specified"
example "filename does not match"
end
context "gist has many files" do
context "filename specified" do
example "matches first file"
example "matches other-than-first file"
example "filename does not match"
end
example "filename not specified"
end
end
example "gist not found"
example "failure downloading gist"
end
context "parsing tag parameters" do
example "all parameters specified" do
pending
# Remember to call the codeblock with filename, then URL
end
example "username not specified"
example "filename not specified"
example "only gist ID specified"
context "failure cases" do
example "no parameters"
example "only username"
example "only filename"
example "username and filename"
end
end
end
context "integrating the pieces into the Liquid extension point" do
it "should be a Liquid tag"
it "should register itself in Liquid"
describe "render()" do
example "happy path"
example "failure rendering code"
example "failure downloading gist"
end
describe "initialize()" do
example "happy path"
example "parsing parameters fails"
end
end
end
gist_no_css tag
the pieces
rendering code
gist ID, username and filename (PENDING: Not yet implemented)
gist ID and filename (PENDING: Not yet implemented)
gist ID and username (PENDING: Not yet implemented)
gist ID (PENDING: Not yet implemented)
downloading gist code
gist not found (PENDING: Not yet implemented)
failure downloading gist (PENDING: Not yet implemented)
gist found
gist has only one file
filename specified (PENDING: Not yet implemented)
filename not specified (PENDING: Not yet implemented)
filename does not match (PENDING: Not yet implemented)
gist has many files
filename not specified (PENDING: Not yet implemented)
filename specified
matches first file (PENDING: Not yet implemented)
matches other-than-first file (PENDING: Not yet implemented)
filename does not match (PENDING: Not yet implemented)
parsing tag parameters
all parameters specified (PENDING: No reason given)
username not specified (PENDING: Not yet implemented)
filename not specified (PENDING: Not yet implemented)
only gist ID specified (PENDING: Not yet implemented)
failure cases
no parameters (PENDING: Not yet implemented)
only username (PENDING: Not yet implemented)
only filename (PENDING: Not yet implemented)
username and filename (PENDING: Not yet implemented)
integrating the pieces into the Liquid extension point
should be a Liquid tag (PENDING: Not yet implemented)
should register itself in Liquid (PENDING: Not yet implemented)
render()
happy path (PENDING: Not yet implemented)
failure rendering code (PENDING: Not yet implemented)
failure downloading gist (PENDING: Not yet implemented)
initialize()
happy path (PENDING: Not yet implemented)
parsing parameters fails (PENDING: Not yet implemented)
@jbrains
Copy link
Author

jbrains commented Oct 24, 2013

Maybe I ought to use specify instead of context, as that words feels like it fits better. Notice that I don't use it very often. I prefer example for many special cases of a single behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment