test/results_test.rb in gemstone-0.1 vs test/results_test.rb in gemstone-0.2
- old
+ new
@@ -88,11 +88,21 @@
def test_gemspec_includes_description
assert_file_includes 'my_gem.gemspec', 's.description = "A short description goes here"'
end
+ def test_gemspec_includes_executable_file_if_selected
+ assert_file_includes 'my_gem.gemspec', 's.executables = ["my_gem"]'
+ end
+ def test_gemspec_doesnt_include_executable_file_if_not_selected
+ @valid_options[:executable] = false
+ GemStone::Generator.new @valid_options
+ assert_file_doesnt_include 'my_gem.gemspec', 's.executables = ["my_gem"]'
+ end
+
+
## README.md
def test_creates_readme
assert_file_created 'README.md'
end
@@ -221,9 +231,14 @@
## test helpers
def assert_file_includes(file_path, content)
path = sandboxed_path file_path
assert File.file?(path) && File.read(path).include?(content), "String '#{content}' not found in #{path}"
+ end
+
+ def assert_file_doesnt_include(file_path, content)
+ path = sandboxed_path file_path
+ assert File.file?(path) && !File.read(path).include?(content), "String '#{content}' found in #{path}"
end
def assert_file_created(file_path)
path = sandboxed_path file_path
assert File.file?(path), "#{path} file not found"
\ No newline at end of file