summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2015-12-15 16:50:07 +0000
committerThom May <thom@may.lt>2015-12-15 16:50:07 +0000
commit7c388602821c02f2da3902a1842f8f3a2f0b0434 (patch)
tree7b162e066c5da90684063b11035f7a4265514040
parentab2fdf0d0c84ac32cda847e813d2f1fc813d891d (diff)
parente196f28b1cdf1ba1e0c2bcdbbcc126aee754daf5 (diff)
downloadohai-7c388602821c02f2da3902a1842f8f3a2f0b0434.tar.gz
Merge pull request #684 from tas50/cucumber
Remove old cucumber tests
-rw-r--r--features/ohai.feature.pending21
-rw-r--r--features/steps/common.rb174
-rw-r--r--features/steps/env.rb6
3 files changed, 0 insertions, 201 deletions
diff --git a/features/ohai.feature.pending b/features/ohai.feature.pending
deleted file mode 100644
index 48f25ba4..00000000
--- a/features/ohai.feature.pending
+++ /dev/null
@@ -1,21 +0,0 @@
-Feature: Collects data about a system
- In order to understand the state of my system
- As a Systems Administrator
- I want to have a program that detects information for me
-
- Scenario: Collect data about the system via a single plugin
- Given a plugin called 'platform'
- When I run ohai
- Then I should have a 'platform' of 'kitties'
-
- Scenario: Collect data about the system via a directory of plugins
- Given a plugin directory at './plugins'
- When I run ohai
- Then I should have a 'platform' of 'kitties'
- And I should have a 'foghorn' of 'leghorn'
-
- Scenario: Collect data about the system via an external script
- Given a plugin called 'perl'
- When I run ohai
- Then I should have a 'perl_major_version' of '5'
- \ No newline at end of file
diff --git a/features/steps/common.rb b/features/steps/common.rb
deleted file mode 100644
index 91cd2611..00000000
--- a/features/steps/common.rb
+++ /dev/null
@@ -1,174 +0,0 @@
-def in_project_folder(&block)
- project_folder = @active_project_folder || @tmp_root
- FileUtils.chdir(project_folder, &block)
-end
-
-def in_home_folder(&block)
- FileUtils.chdir(@home_path, &block)
-end
-
-Given %r{^a safe folder} do
- FileUtils.rm_rf @tmp_root = File.dirname(__FILE__) + "/../../tmp"
- FileUtils.mkdir_p @tmp_root
- FileUtils.mkdir_p @home_path = File.expand_path(File.join(@tmp_root, "home"))
- @lib_path = File.expand_path(File.dirname(__FILE__) + '/../../lib')
- Given "env variable $HOME set to '#{@home_path}'"
-end
-
-Given %r{^this project is active project folder} do
- Given "a safe folder"
- @active_project_folder = File.expand_path(File.dirname(__FILE__) + "/../..")
-end
-
-Given %r{^env variable \$([\w_]+) set to '(.*)'} do |env_var, value|
- ENV[env_var] = value
-end
-
-def force_local_lib_override(project_name = @project_name)
- rakefile = File.read(File.join(project_name, 'Rakefile'))
- File.open(File.join(project_name, 'Rakefile'), "w+") do |f|
- f << "$:.unshift('#{@lib_path}')\n"
- f << rakefile
- end
-end
-
-def setup_active_project_folder project_name
- @active_project_folder = File.join(@tmp_root, project_name)
- @project_name = project_name
-end
-
-Given %r{'(.*)' folder is deleted} do |folder|
- in_project_folder do
- FileUtils.rm_rf folder
- end
-end
-
-When %r{^'(.*)' generator is invoked with arguments '(.*)'$} do |generator, arguments|
- FileUtils.chdir(@active_project_folder) do
- if Object.const_defined?("APP_ROOT")
- APP_ROOT.replace(FileUtils.pwd)
- else
- APP_ROOT = FileUtils.pwd
- end
- run_generator(generator, arguments.split(' '), SOURCES)
- end
-end
-
-When %r{run executable '(.*)' with arguments '(.*)'} do |executable, arguments|
- @stdout = File.expand_path(File.join(@tmp_root, "executable.out"))
- FileUtils.chdir(@active_project_folder) do
- system "ruby #{executable} #{arguments} > #{@stdout}"
- end
-end
-
-When %r{^task 'rake (.*)' is invoked$} do |task|
- @stdout = File.expand_path(File.join(@tmp_root, "tests.out"))
- FileUtils.chdir(@active_project_folder) do
- system "rake #{task} --trace > #{@stdout} 2> #{@stdout}"
- end
-end
-
-Then %r{^folder '(.*)' is created} do |folder|
- in_project_folder do
- File.exists?(folder).should be_true
- end
-end
-
-Then %r{^file '(.*)' (is|is not) created} do |file, is|
- in_project_folder do
- File.exists?(file).should(is == 'is' ? be_true : be_false)
- end
-end
-
-Then %r{^file with name matching '(.*)' is created} do |pattern|
- in_project_folder do
- Dir[pattern].should_not be_empty
- end
-end
-
-Then %r{gem file '(.*)' and generated file '(.*)' should be the same} do |gem_file, project_file|
- File.exists?(gem_file).should be_true
- File.exists?(project_file).should be_true
- gem_file_contents = File.read(File.dirname(__FILE__) + "/../../#{gem_file}")
- project_file_contents = File.read(File.join(@active_project_folder, project_file))
- project_file_contents.should == gem_file_contents
-end
-
-Then %r{^output same as contents of '(.*)'$} do |file|
- expected_output = File.read(File.join(File.dirname(__FILE__) + "/../expected_outputs", file))
- actual_output = File.read(File.dirname(__FILE__) + "/../../tmp/#{@stdout}")
- actual_output.should == expected_output
-end
-
-Then %r{^(does|does not) invoke generator '(.*)'$} do |does_invoke, generator|
- actual_output = File.read(File.dirname(__FILE__) + "/../../tmp/#{@stdout}")
- does_invoke == "does" ?
- actual_output.should(match(/dependency\s+#{generator}/)) :
- actual_output.should_not(match(/dependency\s+#{generator}/))
-end
-
-Then %r{help options '(.*)' and '(.*)' are displayed} do |opt1, opt2|
- actual_output = File.read(@stdout)
- actual_output.should match(/#{opt1}/)
- actual_output.should match(/#{opt2}/)
-end
-
-Then %r{^output (does|does not) match \/(.*)\/} do |does, regex|
- actual_output = File.read(@stdout)
- (does == 'does') ?
- actual_output.should(match(/#{regex}/)) :
- actual_output.should_not(match(/#{regex}/))
-end
-
-Then %r{^contents of file '(.*)' (does|does not) match \/(.*)\/} do |file, does, regex|
- in_project_folder do
- actual_output = File.read(file)
- (does == 'does') ?
- actual_output.should(match(/#{regex}/)) :
- actual_output.should_not(match(/#{regex}/))
- end
-end
-
-Then %r{^all (\d+) tests pass} do |expected_test_count|
- expected = %r{^#{expected_test_count} tests, \d+ assertions, 0 failures, 0 errors}
- actual_output = File.read(@stdout)
- actual_output.should match(expected)
-end
-
-Then %r{^all (\d+) examples pass} do |expected_test_count|
- expected = %r{^#{expected_test_count} examples?, 0 failures}
- actual_output = File.read(@stdout)
- actual_output.should match(expected)
-end
-
-Then %r{^yaml file '(.*)' contains (\{.*\})} do |file, yaml|
- in_project_folder do
- yaml = eval yaml
- YAML.load(File.read(file)).should == yaml
- end
-end
-
-Then %r{^Rakefile can display tasks successfully} do
- @stdout = File.expand_path(File.join(@tmp_root, "rakefile.out"))
- FileUtils.chdir(@active_project_folder) do
- system "rake -T > #{@stdout} 2> #{@stdout}"
- end
- actual_output = File.read(@stdout)
- actual_output.should match(/^rake\s+\w+\s+#\s.*/)
-end
-
-Then %r{^task 'rake (.*)' is executed successfully} do |task|
- @stdout.should_not be_nil
- actual_output = File.read(@stdout)
- actual_output.should_not match(/^Don't know how to build task '#{task}'/)
- actual_output.should_not match(/Error/i)
-end
-
-Then %r{^gem spec key '(.*)' contains \/(.*)\/} do |key, regex|
- in_project_folder do
- gem_file = Dir["pkg/*.gem"].first
- gem_spec = Gem::Specification.from_yaml(`gem spec #{gem_file}`)
- spec_value = gem_spec.send(key.to_sym)
- spec_value.to_s.should match(/#{regex}/)
- end
-end
diff --git a/features/steps/env.rb b/features/steps/env.rb
deleted file mode 100644
index 64d866ce..00000000
--- a/features/steps/env.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-require File.dirname(__FILE__) + "/../../lib/ohai"
-
-gem 'cucumber'
-require 'cucumber'
-gem 'rspec'
-require 'spec'