From 81f9612de2b5cf5f8e983e43479ed8d1d24a944a Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Sat, 17 Aug 2013 12:19:54 +0200 Subject: [PATCH] clean up rspecs --- spec/lib/common/collections/wp_items_spec.rb | 5 +- .../lib/common/collections/wp_plugins_spec.rb | 5 +- spec/lib/common/collections/wp_themes_spec.rb | 5 +- .../detectable/passive_detection.html | 70 +++++++++++-------- .../detectable/passive_detection_2.html | 4 -- .../detectable/passive_detection.html | 70 +++++++++++-------- .../detectable/passive_detection_2.html | 4 -- .../detectable/passive_detection.html | 12 +++- .../detectable/passive_detection_2.html | 4 -- spec/shared_examples/wp_items_detectable.rb | 5 -- 10 files changed, 99 insertions(+), 85 deletions(-) delete mode 100644 spec/samples/common/collections/wp_items/detectable/passive_detection_2.html delete mode 100644 spec/samples/common/collections/wp_plugins/detectable/passive_detection_2.html delete mode 100644 spec/samples/common/collections/wp_themes/detectable/passive_detection_2.html diff --git a/spec/lib/common/collections/wp_items_spec.rb b/spec/lib/common/collections/wp_items_spec.rb index c548f8e1..938d628e 100644 --- a/spec/lib/common/collections/wp_items_spec.rb +++ b/spec/lib/common/collections/wp_items_spec.rb @@ -22,9 +22,8 @@ describe WpItems do WpItem.new(uri, name: 'escaped-url') << WpItem.new(uri, name: 'link-tag') << WpItem.new(uri, name: 'script-tag') << - WpItem.new(uri, name: 'style-tag'), - - passive_detection2: WpItems.new << WpItem.new(uri, name: 'wp-table-reloaded') + WpItem.new(uri, name: 'style-tag') << + WpItem.new(uri, name: 'style-tag-import') } end end diff --git a/spec/lib/common/collections/wp_plugins_spec.rb b/spec/lib/common/collections/wp_plugins_spec.rb index e500e4cb..85cc2e7f 100644 --- a/spec/lib/common/collections/wp_plugins_spec.rb +++ b/spec/lib/common/collections/wp_plugins_spec.rb @@ -23,9 +23,8 @@ describe WpPlugins do WpPlugin.new(uri, name: 'escaped-url') << WpPlugin.new(uri, name: 'link-tag') << WpPlugin.new(uri, name: 'script-tag') << - WpPlugin.new(uri, name: 'style-tag'), - - passive_detection2: WpItems.new << WpItem.new(uri, name: 'wp-table-reloaded') + WpPlugin.new(uri, name: 'style-tag') << + WpPlugin.new(uri, name: 'style-tag-import') } end end diff --git a/spec/lib/common/collections/wp_themes_spec.rb b/spec/lib/common/collections/wp_themes_spec.rb index e7cc5172..31843115 100644 --- a/spec/lib/common/collections/wp_themes_spec.rb +++ b/spec/lib/common/collections/wp_themes_spec.rb @@ -21,9 +21,8 @@ describe WpThemes do passive_detection: WpThemes.new << WpTheme.new(uri, name: 'theme1') << WpTheme.new(uri, name: 'theme 2') << - WpTheme.new(uri, name: 'theme-3'), - - passive_detection2: WpItems.new << WpItem.new(uri, name: 'wp-table-reloaded') + WpTheme.new(uri, name: 'theme-3') << + WpTheme.new(uri, name: 'style-tag-import') } end end diff --git a/spec/samples/common/collections/wp_items/detectable/passive_detection.html b/spec/samples/common/collections/wp_items/detectable/passive_detection.html index cc93dee2..ad48427c 100644 --- a/spec/samples/common/collections/wp_items/detectable/passive_detection.html +++ b/spec/samples/common/collections/wp_items/detectable/passive_detection.html @@ -1,51 +1,65 @@ - + Example.com - + - - - -
-
+ + + + + +
+

- Blablabla the following plugin should not match : /wp-content/items/this-plugin-should-not-match/sub.css + Blablabla the following plugin should not match : /wp-content/items/this-plugin-should-not-match/sub.css

-
- +
+ - - + + - - + + diff --git a/spec/samples/common/collections/wp_items/detectable/passive_detection_2.html b/spec/samples/common/collections/wp_items/detectable/passive_detection_2.html deleted file mode 100644 index 0529d0e0..00000000 --- a/spec/samples/common/collections/wp_items/detectable/passive_detection_2.html +++ /dev/null @@ -1,4 +0,0 @@ -/* */ diff --git a/spec/samples/common/collections/wp_plugins/detectable/passive_detection.html b/spec/samples/common/collections/wp_plugins/detectable/passive_detection.html index 454cf8bb..2ef3f5cb 100644 --- a/spec/samples/common/collections/wp_plugins/detectable/passive_detection.html +++ b/spec/samples/common/collections/wp_plugins/detectable/passive_detection.html @@ -1,51 +1,65 @@ - + Example.com - + - - - -
-
+ + + + + +
+

- Blablabla the following plugin should not match : /wp-content/plugins/this-plugin-should-not-match/sub.css + Blablabla the following plugin should not match : /wp-content/plugins/this-plugin-should-not-match/sub.css

-
- +
+ - - + + - - + + diff --git a/spec/samples/common/collections/wp_plugins/detectable/passive_detection_2.html b/spec/samples/common/collections/wp_plugins/detectable/passive_detection_2.html deleted file mode 100644 index 1b6cfd93..00000000 --- a/spec/samples/common/collections/wp_plugins/detectable/passive_detection_2.html +++ /dev/null @@ -1,4 +0,0 @@ -/* */ diff --git a/spec/samples/common/collections/wp_themes/detectable/passive_detection.html b/spec/samples/common/collections/wp_themes/detectable/passive_detection.html index 6c364ed4..9f484178 100644 --- a/spec/samples/common/collections/wp_themes/detectable/passive_detection.html +++ b/spec/samples/common/collections/wp_themes/detectable/passive_detection.html @@ -8,10 +8,16 @@ - - - + + + +
diff --git a/spec/samples/common/collections/wp_themes/detectable/passive_detection_2.html b/spec/samples/common/collections/wp_themes/detectable/passive_detection_2.html deleted file mode 100644 index 3376c9fe..00000000 --- a/spec/samples/common/collections/wp_themes/detectable/passive_detection_2.html +++ /dev/null @@ -1,4 +0,0 @@ -/* */ diff --git a/spec/shared_examples/wp_items_detectable.rb b/spec/shared_examples/wp_items_detectable.rb index f47ea876..44669a8f 100644 --- a/spec/shared_examples/wp_items_detectable.rb +++ b/spec/shared_examples/wp_items_detectable.rb @@ -155,11 +155,6 @@ shared_examples 'WpItems::Detectable' do @fixture = fixtures_dir + '/passive_detection.html' @expected = expected[:passive_detection] end - - it 'returns the expected items' do - @fixture = fixtures_dir + '/passive_detection_2.html' - @expected = expected[:passive_detection2] - end end end