Skip to content

Commit

Permalink
removing old tests left missing tests as xit
Browse files Browse the repository at this point in the history
  • Loading branch information
orieken committed Mar 24, 2014
1 parent bd618f7 commit 1eec305
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 127 deletions.
14 changes: 0 additions & 14 deletions spec/generators/flow_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,4 @@
end
end
end

context 'failing specs' do

xit "should give you usage if you do not give two arguments" do
FlowGenerator.any_instance.expects(:usage)
lambda { run_generator('flow', [@flow_name], generator_sources) }.should raise_error
end

xit "should give you usage if you give a site that does not exist" do
FlowGenerator.any_instance.expects(:usage)
$stderr.expects(:puts).with(regexp_matches(/NoSuchSite/))
lambda { run_generator('flow', [@flow_name, "NoSuchSite"], generator_sources) }.should raise_error
end
end
end
48 changes: 9 additions & 39 deletions spec/generators/page_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,51 +33,21 @@
expect(system("ruby -c #{page_spec} > #{null_device}")).to be_true
end

it 'the page can be accessed from the site' do
pending 'not sure we need this test now'
xit "should be able to access the generated page from the site" do
run_generator('page', [@page_name, @site_class.to_s], generator_sources)
stub_settings
stub_browser
@site_class.new.check_out_page
end

it 'the page can be accessed for its site' do
pending 'not sure we need this test now'
xit "should be able to access the generated page for its site" do
stub_browser
stub_settings
new_site_class = generate_site('Pag')
run_generator('page', [@page_name, @site_class.to_s], generator_sources)
run_generator('page', [@page_name, new_site_class.to_s], generator_sources)
new_site_class.new.check_out_page.class.should_not eql(@site_class.new.check_out_page.class)
end
end
end

context 'failing specs' do
xit "should give you usage if you do not give two arguments" do
PageGenerator.any_instance.expects(:usage)
lambda { run_generator('page', [@page_name], generator_sources) }.should raise_error
end

xit "should give you usage if you give a site that does not exist" do
PageGenerator.any_instance.expects(:usage)
$stderr.expects(:puts).with(regexp_matches(/NoSuchSite/))
lambda { run_generator('page', [@page_name, "NoSuchSite"], generator_sources) }.should raise_error
end

xit "should generate a page spec that can be required" do
run_generator('page', [@page_name, @site_class.to_s], generator_sources)
page_functional_spec = File.join(PROJECT_FOLDER, 'spec', 'isolation', @site_class.to_s.underscore, 'check_out_page_spec.rb')
system("ruby -c #{page_functional_spec} > #{null_device}").should be_true
end

xit "should be able to access the generated page from the site" do
run_generator('page', [@page_name, @site_class.to_s], generator_sources)
stub_settings
stub_browser
@site_class.new.check_out_page
end

xit "should be able to access the generated page for its site" do
stub_browser
stub_settings
new_site_class = generate_site('Pag')
run_generator('page', [@page_name, @site_class.to_s], generator_sources)
run_generator('page', [@page_name, new_site_class.to_s], generator_sources)
new_site_class.new.check_out_page.class.should_not eql(@site_class.new.check_out_page.class)
end
end
end
30 changes: 9 additions & 21 deletions spec/generators/partial_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,18 @@
context "taza partial navigation foo_site" do
context "creates" do

let(:subject) { Taza::PartialGenerator.new(['navigation', 'foo_site']) }
let(:output) { capture(:stdout) { subject.partial } }
let(:subject) { Taza::PartialGenerator.new(['navigation', 'foo_site']) }
let(:output) { capture(:stdout) { subject.partial } }

it 'a navigation.rb' do
expect(output).to include('lib/sites/foo_site/pages/partials/navigation.rb')
expect(File.exists?('lib/sites/foo_site/pages/partials/navigation.rb')).to be_true
end

it 'message if site does not exist' do
bar_page = capture(:stdout) { Taza::PartialGenerator.new(['navigation', 'bar_site']).partial }
expect(bar_page).to include("No such site bar_site exists")
end
it 'a navigation.rb' do
expect(output).to include('lib/sites/foo_site/pages/partials/navigation.rb')
expect(File.exists?('lib/sites/foo_site/pages/partials/navigation.rb')).to be_true
end
end
context 'failing specs' do
xit "should give you usage if you do not give two arguments" do
PartialGenerator.any_instance.expects(:usage)
lambda { run_generator('partial', [@partial_name], generator_sources) }.should raise_error
end

xit "should give you usage if you give a site that does not exist" do
PartialGenerator.any_instance.expects(:usage)
$stderr.expects(:puts).with(regexp_matches(/NoSuchSite/))
lambda { run_generator('partial', [@partial_name, "NoSuchSite"], generator_sources) }.should raise_error
it 'message if site does not exist' do
bar_page = capture(:stdout) { Taza::PartialGenerator.new(['navigation', 'bar_site']).partial }
expect(bar_page).to include("No such site bar_site exists")
end
end
end
end
29 changes: 8 additions & 21 deletions spec/generators/project_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,16 @@
expect(output).to include('spec/spec_helper.rb')
expect(File.exists?('spec/spec_helper.rb')).to be_true
end
end
end


describe 'old broken tests' do
xit "should generate a spec helper that can be required" do
run_generator('taza', [APP_ROOT], generator_sources)
system("ruby -c #{@spec_helper} > #{null_device}").should be_true
end

xit "should generate a rakefile that can be required" do
run_generator('taza', [APP_ROOT], generator_sources)
system("ruby -c #{@spec_helper} > #{null_device}").should be_true
end

xit "should generate a console script" do
run_generator('taza', [APP_ROOT], generator_sources)
File.exists?(File.join(APP_ROOT, 'script', 'console')).should be_true
end
xit "should generate a console script" do
run_generator('taza', [APP_ROOT], generator_sources)
File.exists?(File.join(APP_ROOT, 'script', 'console')).should be_true
end

xit "should generate a windows console script" do
run_generator('taza', [APP_ROOT], generator_sources)
File.exists?(File.join(APP_ROOT, 'script', 'console.cmd')).should be_true
xit "should generate a windows console script" do
run_generator('taza', [APP_ROOT], generator_sources)
File.exists?(File.join(APP_ROOT, 'script', 'console.cmd')).should be_true
end
end
end
end
32 changes: 0 additions & 32 deletions spec/generators/site_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,4 @@
end
end
end

context 'old failing specs' do
xit "should generate configuration file for a site" do
run_generator('site', [@site_name], generator_sources)
File.exists?(File.join(PROJECT_FOLDER, 'config', 'wikipedia_foo.yml')).should be_true
end

xit "should generate a site path for pages" do
run_generator('site', [@site_name], generator_sources)
File.directory?(@site_folder).should be_true
end

xit "should generate a partials folder under pages" do
run_generator('site', [@site_name], generator_sources)
File.directory?(File.join(@site_folder, "pages", "partials")).should be_true
end

xit "should generate a folder for a sites isolation tests" do
run_generator('site', [@site_name], generator_sources)
File.directory?(File.join(PROJECT_FOLDER, 'spec', 'isolation', 'wikipedia_foo')).should be_true
end

xit "generated site that uses the block given in new" do
@site_class = generate_site(@site_name)
stub_settings
stub_browser
foo = nil
@site_class.new { |site| foo = site }
foo.should_not be_nil
foo.should be_a_kind_of(Taza::Site)
end
end
end

0 comments on commit 1eec305

Please sign in to comment.